Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Unexpected parsingby ikegami (Patriarch) |
on Dec 16, 2009 at 08:18 UTC ( [id://812992]=note: print w/replies, xml ) | Need Help?? |
It takes next to nothing to make the cond op unreadable, but using it as an lvalue itself doesn't make it unreadable.
It appears to be another case where heuristics enter into play. my is a valid attribute name, so : my is presumed to be an attribute. $d is not a valid attribute name, so : $d is taken to be the else expression of the conditional. Untested, but parens should clear that up.
Note that conditionally executing my officially results in undefined behaviour.
In Section
Seekers of Perl Wisdom
|
|