Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: divide one file into multiple arraysby LanX (Saint) |
on Jun 25, 2013 at 17:33 UTC ( [id://1040635]=note: print w/replies, xml ) | Need Help?? |
> print "@bad_log\n"; #currently returns entire $log The code is fine¹, I suppose your @sites have an empty string or so, which always matches! try pushing the regex too, to see what matches in the dump of @bad_log. push @bad_log, [$_,$site] if ($_ =~ /$site/); By the way you'll get multiple entries per line if different sites match!
Cheers Rolf ( addicted to the Perl Programming Language) ¹) in the sense of "it works", not in the sense of "well coded" =)
In Section
Seekers of Perl Wisdom
|
|