Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by revdiablo (Prior)
on Aug 09, 2005 at 17:30 UTC ( #482323=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array = (1 .. 1000);
    my @toremove = (7,1,6,5,3);
    ...
    for (sort { $b <=> $a } @toremove) {
        splice @array, $_, 1;
    }
    
  2. or download this
    # another way to to it:
    
    for (reverse sort @toremove) { ... }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2019-11-12 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (64 votes). Check out past polls.

    Notices?