> That looks fine, but Perl is trying to interpolate $mynames (which
> hasn't been initalised) into the string instead of indexing an element
> of @mynames.
>
> You may be running an old perl. Please check your version with
>
>  perl -v

I have 5.12.3 on this PC, The strawberry perl release.

>
> and, in the mean time, fix your program by changing the print statement
> to
>
>  print $mynames[$_-1], "\n";
>
> HTH,
>
> Rob
>
Yes that got it all working. Regarding the actual $_ that as I read it
is the perl default.

So in the context of this program is it saying whatever the default is
in the foreach loop for $mynames -1 from it(to correct the index) and
proceed.

Sayth

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to