Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have defined array @route, where am storing 100 values. I need to access only 10 of them for a purpose. Is there a way to do this in perl
for (1..100) { <> push @route, $route_su; }
Am trying to get first 10 values like this,
$route[1..10] $route[1-10].Both of them did not work.i do not want use any sort of loop command to achieve this
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Accessing multiple array index
by hippo (Archbishop) on Jan 17, 2016 at 16:48 UTC | |
|
Re: Accessing multiple array index
by 1nickt (Canon) on Jan 17, 2016 at 16:55 UTC | |
|
Re: Accessing multiple array index
by GrandFather (Saint) on Jan 17, 2016 at 19:51 UTC | |
|
Re: Accessing multiple array indexes
by Athanasius (Archbishop) on Jan 18, 2016 at 03:07 UTC | |
by Anonymous Monk on Jan 18, 2016 at 06:42 UTC | |
|
Re: Accessing multiple array index
by hotchiwawa (Scribe) on Jan 17, 2016 at 16:38 UTC | |
by GrandFather (Saint) on Jan 18, 2016 at 00:48 UTC |