Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: array index -1 oddity

by Aristotle (Chancellor)
on Dec 07, 2002 at 13:04 UTC ( [id://218241]=note: print w/replies, xml ) Need Help??


in reply to array index -1 oddity

If you really do need something like that (I'd think about that first), you can write it briefly as $arr[@arr ? $#arr : 0] = $foo; or maybe (@arr ? $arr[-1] : $arr[0]) = $foo;

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found