Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Print last line in a file

by Beatnik (Parson)
on Aug 22, 2001 at 11:40 UTC ( [id://106889]=note: print w/replies, xml ) Need Help??


in reply to Print last line in a file

Without slurping the entire file in an array, without the shell calls and the modules, I'd stick to
open(FILE,"< filename") || die $!; while($line=<FILE>) {} close(FILE); print $line;

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://106889]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-19 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found