Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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
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 browsing the Monastery: (5)
As of 2019-11-22 00:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (107 votes). Check out past polls.

    Notices?