Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Re: Re: Printing the last few elements of an array.

by dakkar (Hermit)
on Dec 19, 2002 at 09:07 UTC ( #221073=note: print w/replies, xml ) Need Help??

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
    I really appreciate this, dakkar - I understand what pain it must have caused you to write that. I do promise not to use it - but it's very useful for me to see how it works! Thank you.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://221073]
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-25 04:34 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (84 votes). Check out past polls.