Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by revdiablo (Prior)
on Aug 09, 2005 at 17:30 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://482323]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found