Rob Dixon wrote:
> ...
> You're right, I'm wrong, and I hereby resign.
> 
>     perl -p -i -e "redo if /^\s*$/" file.ext
> 
> is completely wrong, as the redo doesn't pull in the next line from
> the input. It simply retests the same blank line indefinitely. The
> neater 
> 
>     perl -p -i -e "s/^\s*$//" file.ext
> 
> is the correct way.

Why not just

   perl -pi -e 'next if /^$/';           # skip empty lines

or,

   perl -pi -e 'next unless /\S/';       # skip lines containing only
whitespace

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to