Welcome to the Monastery | |
PerlMonks |
Re: Re: Re: removing blank lines from filesby mirod (Canon) |
on Jun 20, 2002 at 13:35 UTC ( [id://176005]=note: print w/replies, xml ) | Need Help?? |
Actually Perl DWIMs properly here, and /^\s+$/ catches empty lines. The $ is quite magic, if the \n at the end of the string/line is matched then $ matches the empty end-of-string, if the \n is not matched then $ matches it, plus the end-of-string. You can test it with this code:
In Section
Seekers of Perl Wisdom
|
|