John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
because $result isn't defined inside the do block. Yet, something like read (FH, my $buffer, 999) works just fine, even though this would seem to be the same situation: the variable is defined inside the expression where it is used.my $result= do { $result += $_ foreach (@items) };
It sounds more like a lexer issue, in that the name isn't known elsewhere in the expression, even though the variable is in fact defined! I've not explored that hypothosis, but wonder if anyone already knew.
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: when does the definition of a my variable take effect?
by Aristotle (Chancellor) on Aug 23, 2002 at 03:04 UTC | |
by John M. Dlugosz (Monsignor) on Aug 23, 2002 at 03:18 UTC | |
|
Re: when does the definition of a my variable take effect?
by sauoq (Abbot) on Aug 23, 2002 at 03:09 UTC | |
by greenFox (Vicar) on Aug 23, 2002 at 04:21 UTC | |
|
Re: when does the definition of a my variable take effect?
by particle (Vicar) on Aug 23, 2002 at 14:07 UTC | |
|
Re: when does the definition of a my variable take effect?
by rinceWind (Monsignor) on Aug 23, 2002 at 09:25 UTC |