go ahead... be a heretic | |
PerlMonks |
Re: Print last line in a fileby tachyon (Chancellor) |
on Aug 22, 2001 at 03:45 UTC ( [id://106825]=note: print w/replies, xml ) | Need Help?? |
Using what you have already a simple modification does it - we just loop through the file setting each line to $last. At the end of the while loop $last will actually be the last line! This is momory efficient:
PS if you enclose your code in <code> </code> tags it will retain its formatting. Hope this helps. cheers tachyon s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In Section
Seekers of Perl Wisdom
|
|