Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Printing the last few elements of an array.

by thinker (Parson)
on Dec 16, 2002 at 11:40 UTC ( [id://220174]=note: print w/replies, xml ) Need Help??


in reply to Printing the last few elements of an array.

Hi jonnyfolk,

one way would be
#!/usr/bin/perl -w use strict; my $record='DATA'; open (FILE, "$record") or die $!; my @record = reverse <FILE>; print "@record[0..9]";

cheers

thinker

Replies are listed 'Best First'.
Re: Re: Printing the last few elements of an array.
by jonnyfolk (Vicar) on Dec 16, 2002 at 14:31 UTC
    Thanks, thinker. Quick'n'easy - just the job!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://220174]
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: (4)
As of 2024-03-29 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found