On Sunday 06 Feb 2011 16:02:05 Offer Kaye wrote: > On Sun, Feb 6, 2011 at 1:39 PM, Shlomi Fish wrote: > > Yes, these message are indicative that use strict (or at least "use > > strict vars" IIRC) were enabled and you did not declare variables using > > my. > > What's confusing me is that Micky originally wrote: > > Upon going from "use 5.10" to 5.12.2 > > Why should simply going from "use 5.10;" to "use 5.12.2;" turn on "use > strict;"? > > Micky, did you also add "use strict;" to your code? If you did and > don't understand what it does, please read: > http://perldoc.perl.org/strict.html >
Actually, "use 5.012;" adds "use strict;" by default (but not "use warnings;" unfortunately.) as a way to help curb the amount of boilerplate needed in perl programs and modules in the future. See also: http://search.cpan.org/dist/Modern-Perl/ In an ideal world, Perl 5 would have had strict and warnings enabled by default right from perl-5.000, but naturally since it evolved from perl 1 through perl 4 which didn't have lexical scoping and the my keyword (and perl 1 had no scoping at all), it was not done to avoid breaking compatibility. I should also note that I prefer Perl's or Scheme's explicit lexical scoping over Python's or Ruby's implicit scoping, where variables spring into existence upon use, and often typos are not easily caught. Naturally, its benefits are harder to do in Perl when one forgets to add strict; or warnings; or removes or comments it out (which I've seen often in other people's code). Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Stop Using MSIE - http://www.shlomifish.org/no-ie/ Chuck Norris can make the statement "This statement is false" a true one. Please reply to list if it's a mailing list post - http://shlom.in/reply . _______________________________________________ Perl mailing list Perl@perl.org.il http://mail.perl.org.il/mailman/listinfo/perl