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

Re: popping, shifting or splicing an array???

by shiza (Hermit)
on Aug 09, 2005 at 17:33 UTC ( #482325=note: print w/replies, xml ) Need Help??


in reply to popping, shifting or splicing an array???

Since you are dealing with numbers you could just set the value of an array element to its' index. Instead of getting rid of a selected value, you could set it equal to undef when selected.

A benefit to doing this way would be the minute amount of code needed to maintain your array.

This is probably not the best way to handle this programatically, but it would work.

I'm sure there are a lot of arguments against doing it this way and am interested in hearing them.
  • Comment on Re: popping, shifting or splicing an array???

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://482325]
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 2023-01-27 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?