Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Remove array elements dynamically!

by snoopy (Deacon)
on Aug 28, 2007 at 23:58 UTC ( #635698=note: print w/ replies, xml ) Need Help??


in reply to Remove array elements dynamically!

Another approach is to create a complementary index, then take the array slice.

my @keep = (0..$#array); $keep[$_] = undef for (@arrayindex); @array = @array[grep {defined $_} @keep];


Comment on Re: Remove array elements dynamically!
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-07-28 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (190 votes), past polls