Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re (tilly) 2: Print last line in a file

by tilly (Archbishop)
on Aug 22, 2001 at 06:22 UTC ( #106865=note: print w/replies, xml ) Need Help??

in reply to Re: Print last line in a file
in thread Print last line in a file

Your open should have an error check as described in perlstyle.

This is usually done explicitly, but the various shortcuts do so as well. For instance try this:

@ARGV="your_file"; print((<>)[-1]);
BTW I really did need both pairs of parens.

Replies are listed 'Best First'.
Re: Re (tilly) 2: Print last line in a file
by nehlwyn (Acolyte) on Aug 22, 2001 at 06:44 UTC

    Greetings fellow monk,

    You're dammmn right , sir ... 'was a bit hasty of me ... But fortun'ly , 'had a fellow monk to DWIM(eant) ...;-)

    the little one.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2022-05-27 06:03 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (94 votes). Check out past polls.