|
|
| more useful options | |
| PerlMonks |
Re: Perl substitution not workingby muba (Curate) |
| on Jun 21, 2012 at 00:45 UTC ( #977519=note: print w/ replies, xml ) | Need Help?? |
|
My guess? Because the commas are each part of another element of @L1, because they had "notice", "[", "mpmstats:", or "\t" inbetween them. Try this fix:
See how I wrote your [[] as \[? I think it's more readable that way. Also, regular expression understand \t just fine. There's no need to put it into a character class. And if ( ($line =~ /notice/) && ($line =~ /rdy/) ) { pretty much does the same thing as your two if statements. The inner parens are optional, but I prefer to write it that way.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||