Perl: the Markov chain saw | |
PerlMonks |
Re^5: Short form (ternary) if elseby Riales (Hermit) |
on Feb 08, 2012 at 22:22 UTC ( [id://952606]=note: print w/replies, xml ) | Need Help?? |
Wrong, it can indeed execute code:
This prints: I think what you're confused about is still scope; like the if/else block in the original post, if you declare my $vxdg inside the ternary operator, it will fall out of scope before you try to access it again.
In Section
Seekers of Perl Wisdom
|
|