Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: array question

by roboticus (Chancellor)
on Jun 30, 2010 at 22:26 UTC ( [id://847424]=note: print w/replies, xml ) Need Help??


in reply to array question

gogoglou:

You can use the slice syntax to get a set of array elements:

my @array = (0 .. 50); my @first5 = @array[0..4]; my @allButFirst = @array[1..$#array]; my @FirstThirdAndEighth = @array[0,2,7];

For details, read perldoc perldata and look for "slice" to find information about array and hash slicing.

...roboticus

Log In?
Username:
Password:

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

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

    No recent polls found