in reply to Re: array element as foreach iterator
in thread array element as foreach iterator
It's consistent with the documentation, which says a VAR is expected (with an optional my).
It should be pointed out that if the variable is already declared lexical in an enclosing scope then the my is assumed. i.e. it is not the previously declared lexical that is used but a different one.
IMNSHO perl should throw a warning when it infers an implicit my.
|
|---|