Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How do I get the last element of an array?

by eg (Friar)
on Dec 03, 2000 at 15:29 UTC ( [id://44665]=note: print w/replies, xml ) Need Help??


in reply to How do I get the last element of an array?

Here's a rather unconventional way:
push @array, my $val = pop @array;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found