Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
RE: Re: Writing to filesby chromatic (Archbishop) |
on Apr 10, 2000 at 21:01 UTC ( [id://7246]=note: print w/replies, xml ) | Need Help?? |
I had better luck with this:
perl -i -p -e 'print "first line\n" if $. == 1;' data
It depends on the particular magic of $., of course.
In Section
Seekers of Perl Wisdom
|
|