Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: delete n elements of an array

by jwkrahn (Monsignor)
on Nov 25, 2012 at 13:03 UTC ( #1005484=note: print w/ replies, xml ) Need Help??


in reply to delete n elements of an array

$ perl -le' my @array = 1 .. 20; print "@array"; splice @array, 0, 15; print "@array"; ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 16 17 18 19 20


Comment on Re: delete n elements of an array
Download Code
Re^2: delete n elements of an array
by Anonymous Monk on Nov 25, 2012 at 13:11 UTC

    Thanks monk, 1 more doubt. what should I do if I want to Pop 15 elements, ie, from last I want to cut. Thanks in advance.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2015-07-02 21:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (45 votes), past polls