Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: pop and shift not reversible

by BillKSmith (Monsignor)
on Mar 20, 2020 at 14:42 UTC ( [id://11114523]=note: print w/replies, xml ) Need Help??


in reply to pop and shift not reversible

The solutions Re: pop and shift not reversible proposed by hippo and Re: pop and shift not reversible ( while @array ) proposed by Anonymous Monk are not the same if the data array contains undefined elements. The later probably better answers the question in your title because it does not depend on the contents of the array, only its size. On the other hand, the former is often preferred precisely because it does not return undefined data at the end of the array.
Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found