in reply to Re^4: simple array question
in thread simple array question
Thanks for the encouragement Marshall
You have partly anticipated my next hurdle
I am ok with using foreach to loop through all the elements but am struggling with returning particular values....for example if I only wanted to return the first value of @another_compass into a new array. i.e.
NW W SW
have tried a number of things similar to this...
but obviously not correct, I used a split in place of shift with a slightly different problem so I thought shift would work. Although i assume you would need a different solution if the second value was required. Any pointers will be appreciated.my @first_value = (); for my $compass_row (@another_compass) { push (@first_value, shift); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: simple array question
by Marshall (Canon) on Jan 03, 2011 at 13:37 UTC | |
by tw (Acolyte) on Jan 03, 2011 at 15:33 UTC | |
by Jim (Curate) on Jan 03, 2011 at 21:58 UTC | |
by tw (Acolyte) on Jan 04, 2011 at 03:04 UTC | |
by Marshall (Canon) on Jan 05, 2011 at 23:44 UTC | |
|
Re^6: simple array question
by Marshall (Canon) on Jan 03, 2011 at 14:10 UTC |