Why use -n and not -p here?:
perl -i.bak -pe 'print "\n" if($.==1)'or in the Perl Golf spirit:
perl -i.bak -pe 's/^/\n/ if($.==1)'Update:Darn! fundflow is right! So let's try:
perl -i.bak -pe 's/^/\n/ if(!$a); $a= !eof'This one should work fine
In reply to Re: Yet another one-liner
by mirod
in thread Yet another one-liner
by wardk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |