Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Pattern match arrayby thezip (Vicar) |
on May 07, 2008 at 15:09 UTC ( [id://685231]=note: print w/replies, xml ) | Need Help?? |
This would better be coded using a hash:
Update: If you absolutely need to have the @prim array, then create the hash on-the-fly using map: Update2 After reading moritz's take on this, his seems to be what you're looking for. I was somehow thinking that you were parsing chunks (ie. words) and then seeing if that word existed in your array/hash. moritz is also spot-on mentioning that you're not handling the newlines at the ends of lines. Your wish is my commandline.
In Section
Seekers of Perl Wisdom
|
|