Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Printing Last Element of a line using perl memory?

by dave_the_m (Monsignor)
on Feb 15, 2013 at 12:53 UTC ( [id://1018887]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # open the file using _ to avoid multiple system calls invoked by perl
    open _,"filename";
    
  2. or download this
    my @lines=<_>;
    
  3. or download this
    @lines[$#lines];
    
  4. or download this
    Scalar value @lines[$#lines] better written as $lines[$#lines]
    
  5. or download this
    $lines[-1]
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (None)
    As of 2024-04-25 03:56 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found