in reply to Re: Counting variable initialization
in thread Counting variable initialization

Deparse is wrong in this case, on two counts: 1) print($t) is not strict safe in the deparsed version, but it is in the original, and 2) print($t) prints the package variable in the deparsed version, but not in the original.

To answer the OP, my is considered a function for syntax purposes, so my ... foreach ...; means (my ...) foreach ...;, which makes no sense.

Replies are listed 'Best First'.
Re^3: Counting variable initialization
by tlm (Prior) on Mar 29, 2005 at 18:52 UTC

    I wondered about the fact that strict seemed to be violated. I defer to your interpretation, but it is a bummer to know that Deparse can be wrong, because I use it quite a bit. Sorry to the OP for the wrong info.

    the lowliest monk