The stupid question is the question not asked | |
PerlMonks |
Re^3: Comparing two arraysby Athanasius (Archbishop) |
on Feb 21, 2015 at 04:35 UTC ( [id://1117396]=note: print w/replies, xml ) | Need Help?? |
Hello GrandFather, This is an excellent point! In:
it’s as though there were an implicit for local $var (...) {...} — except (a) that syntax is illegal, and (b) local doesn’t create an alias (which in C++ would be called a reference) as the for loop does. But thinking of what’s going on as an implicit local does, perhaps, explain why the strict pragma is fooled into thinking $var has been declared:
Is there any way to get strict, warnings, or something similar to flag this as a probable error? BTW, congratulations on your promotion to Sage!
In Section
Seekers of Perl Wisdom
|
|