instead of@lines = grep { $_ !~ /^\s*\n?\r?$/ } @lines
(i.e., s/!=/!~/).@lines = grep { $_ != /^\s*\n?\r?$/ } @lines
Also as a nitpick, \s is an abbreviation to the character class [\ \t\r\n\f] (reference: perlreftut)so the \n and the \r are never matched as the * is greedy (i.e. they are unnecessary).
-enlil
In reply to Re: Re: strip out lines until match
by Enlil
in thread strip out lines until match
by alienhuman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |