I know that there is a statement about this in one of the perl docs, although I cannot find it now.

From perlsyn:

NOTE: The behaviour of a "my" statement modified with a statement mod+ifier conditional or loop construct (e.g. "my $x if ...") is undefine+d. The value of the "my" variable may be "undef", any previously ass+igned value, or possibly anything else. Don't rely on it. Future ve+rsions of perl might do something different from the version of perl +you try it out on. Here be dragons.

Yes, it is a well known behaviour not intended as a feature, that someone uses as if it were reliable semantic: although it is to be noted that even if it's not strictly a bug, such behaviour is not reliable and is left undefined by the specs (as of the docs). So it's better not to use it, period.

Logically, it doesn't make much sense at all to want have a declaration depending on a modifier: would you really like to have a lexical variable exist or not depending on a condition in the surrounding lexical scope?!?

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other