News for hackers. Stuff that matters.
Re:Why I Left Perl by draegtun on Tuesday February 14, 2012 @10:55AM (#3590425)
> I have to add "my" to a variable to get reasonably-sane scoping, the default is that everything's global

To be precise if strict is not enabled then any variable declared without a "my" becomes a package variable.

With use strict enabled then any variable declared without my, our or state will give a compilation error.

> Perl's defaults tend more to the insane side of the spectrum, especially in comparison with Python

Actually Perl with use strict is the sanest IMHO. Because this means that Perl avoids the sloppy (but serious) errors that can easily creep into code in languages that don't have explicit scoping / variable declaration: http://news.ycombinator.com/item?id=3087990 | http://news.ycombinator.com/item?id=3587659

There are no comments on this comment yet.