Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by dave_the_m (Prior)
on Feb 15, 2013 at 12:53 UTC ( #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
Node Status?
node history
Node Type: note [id://1018887]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2018-07-18 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (383 votes). Check out past polls.

    Notices?