[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Re: $_ global



At 11.28 97/2/14, Mark Manning/Metrica wrote:
The Perl book
>clearly states that the value of $_ is replaced in loops
>such as the one you had.

Clarification: the value of VAR in:

        foreach VAR (EXPR) {}

is local to the loop.  When VAR is omitted, it defaults to $_, as in the
example.

#================================================================
Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6