Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: My questions: new to perl

by JavaFan (Canon)
on Mar 13, 2011 at 20:30 UTC ( #892992=note: print w/replies, xml ) Need Help??


in reply to Re^3: My questions: new to perl
in thread My questions: new to perl

Are you saying you disagree with the conclusion?
Most certainly.

strict has been around as long as perl5. Which is as long as we have namespaces, and Exporter. Exporter only works by doing things strict forbids - but which weren't even possible before. So, strict forbids something that has only been possible for as long as strict exists. Not really "for backwards compatible reasons".

By the way, strict is now on by default in Perl 5.12
Except that it's not.
print $], "\n"; $foo = 3; print $foo, "\n"; __END__ 5.012001 3
Perhaps you mean that use 5.012; implies use strict;?
Comma in qw() is most definitely likely to be an error.
They are seldomly an error in my code (for instance, in the code shown), and nor are #'s in my qw's.
I for one have taken advantage of this warning a couple of times.
That I will not deny. But since the presence of commas can be detected without running the program, I do not think checking for this at every run is required. This is something that belongs in a linter. Perlcritic is a linter, and works wonders for tons of people.

Replies are listed 'Best First'.
Re^5: My questions: new to perl
by ikegami (Pope) on Mar 14, 2011 at 14:40 UTC

    By the way, strict is now on by default in Perl 5.12

    Except that it's not.

    Did you deliberately misquote me? I specifically said version 5.12 of the interpreter wasn't sufficient.

    Since 5.10, Perl has been changing in backwards incompatible ways. To get the latest version of the language, you need to request it using use 5.010; or similar.

    But since the presence of commas can be detected without running the program, I do not think checking for this at every run is required.

    Either you didn't express yourself properly, or you just advocated that strict var checks be moved to the linter.

      Did you deliberately misquote me? I specifically said version 5.12 of the interpreter wasn't sufficient.

      Since 5.10, Perl has been changing in backwards incompatible ways. To get the latest version of the language, you need to request it using use 5.010; or similar.

      Did you mean you found a convoluted way (which I did not understand) to describe use 5.012;? If you meant that, why didn't you say so?

      Not that I agree use 5.YYY; switches to different versions of the language. Or that without using use 5.XXX; you won't be getting any of the latest version. *Most* changes of the language you'll get with, or without use 5.XXX. (Smart match for instance, all of the regexp changes, new versions of Unicode, etc).

      Either you didn't express yourself properly, or you just advocated that strict var checks be moved to the linter.
      First of all, strictness checks aren't warnings. Second, due to exporting, one actually needs to run code to know what's being exported - and hence whether strict vars will complain or not.

        I agree that simply using perl 5.12 gets you most of Perl 5.12. Specifically, you get bug fixes and features that aren't backwards incompatible. For the rest of the features, you need the pragma.

        Did you mean you found a convoluted way (which I did not understand) to describe use 5.012;?

        Saying that use 5.012; causes the Perl 5.12 language to be used is hardly convoluted. But no, I wasn't describing use 5.012;, I was talking about strict in Perl 5.12.

        *Most* changes of the language you'll get with, or without use 5.XXX. (Smart match for instance, all of the regexp changes, new versions of Unicode, etc).

        Actually, some of the regex and unicode changes require use 5.xxx; because they aren't backwards compatible.

        Second, due to exporting, one actually needs to run code to know what's being exported

        Granted, I forgot that.

        Let's say it was impossible to export variables. Would you still say that use strict 'vars'; should be done by a linter instead of Perl itself?

        The point is I think your condition for deciding if something should be done by a linter instead of perl is insufficient. This renders your argument unconvincing.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://892992]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2019-10-19 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?