in reply to syntax question
\my($x) returns a reference to the $x declared by the my. The brackets are required around $x to avoid $x, __PACKAGE__ being treated as a list of variables associated with the my. In fact the effect is the same if the ( is moved to the left of the my.
So, $x is declared, albeit in a slightly disguised fashion. And the \ doesn't act on the my, but on the newly defined $x 'returned' by the my.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: syntax question
by JavaFan (Canon) on Sep 21, 2010 at 09:46 UTC |