Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by eg (Friar)
on Dec 03, 2000 at 15:29 UTC ( #44665=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > How do I get the last element of an array? - Answer contributed by eg

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

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2020-10-20 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (209 votes). Check out past polls.

    Notices?