in reply to Re: Re: Printing the last few elements of an array.
in thread Printing the last few elements of an array.
@record=reverse @record; my @record1; my $count=0; my $line; while (($count<5) && ($line=$record[$count])) { push @record1,$line; $count++ } @record1=reverse @record1; print join ',',@record1;
The last reverse is to get the elements in the original order.
Just promise me you won't really use this version, please? ;-)))
-- dakkar - Mobilis in mobile
|
---|
Replies are listed 'Best First'. | |
---|---|
Thanks dakkar
by jonnyfolk (Vicar) on Dec 20, 2002 at 00:02 UTC |
In Section
Seekers of Perl Wisdom