That should leave $entire_file with only nonblank lines
This is assuming that blank lines are TRUELY blank (no spaces). This is more general:
perl -pi -e 's!^\s+?$!!' file.txt or s!^(\n|\s+)$!!g
Cheers,
KM
In reply to Re: Re: replacing blank lines
by KM
in thread replacing blank lines
by indapa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |