Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by shiza (Hermit)
on Aug 09, 2005 at 17:33 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found