Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Possible useless use of mapby ikegami (Patriarch) |
on Mar 18, 2010 at 20:40 UTC ( [id://829481]=note: print w/replies, xml ) | Need Help?? |
By that logic, the following shouldn't warn since calling f() isn't useless:
You're mistaken about what gives the warning. The op that does the autovivification is not the one issuing the warning. It's the access of the foo element that issues the warning, and it's indeed useless to access the foo element.
is basically equivalent to
The last bit is clearly useless. If you prefer a diagram,
Similar, without useless bits:
Warnings aren't always accurate. That's why you can turn them off. Update: Additions for the sake of clarity.
In Section
Seekers of Perl Wisdom
|
|