>>>>> ""Chas" == "Chas Owens" <chas.ow...@gmail.com> writes:
"Chas> This one handles multiple files:

"Chas> perl -pe '$.=1 && $o=$ARGV unless $o eq $ARGV; s/$/,$./' file1 file2

If you see perlvar, it hints at an easier way to reset $. from the perlfunc
page under eof():

  perl -pe 's/$,$./; close ARGV if eof;' file1 file2

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to