in reply to Reading parts of array elements
Perl offers many ways to do that, depending on what you want to achieve. For example you could:
my @subArray = grep {/^x/} @foo;
to get all the elements that contain a string starting with x. Or you could:
my @firstLetters = map {substr $_, 0, 1} @foo;
to get an array of the first letter of each element in @foo. Or you could:
my @asLetters = map {[split '']} @foo;
to get an array of arrays of individual letters - each @asLetters element is an array of the letters in the corresponding string from @foo.
Now, what was it you wanted?
|
|---|