Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Categorized Questions and Answers: tips and tricks

by demerphq (Chancellor)
on Jun 23, 2005 at 08:06 UTC ( #469313=note: print w/replies, xml ) Need Help??


in reply to Categorized Questions and Answers: tips and tricks

Actually iirc you are better off using push/pop and $array[-1] instead of shift/unshift and $array[0] From what i remember (i should recheck the source) perls arrays are written with a slight bias towards adding things to the end over sticking them on the front.

Also why stop at a stack? You can implement a queue with unshift/push, and a deque with unshift/shift and push/pop.

---
$world=~s/war/peace/g

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2020-06-05 03:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (35 votes). Check out past polls.

    Notices?