Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Categorized Questions and Answers: tips and tricks

by demerphq (Chancellor)
on Jun 23, 2005 at 08:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://469313]
help
Chatterbox?
and the web crawler heard nothing...

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

      No recent polls found