Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^7: Writing a better Modern::Perl

by ikegami (Pope)
on Oct 08, 2010 at 21:11 UTC ( #864279=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Writing a better Modern::Perl
in thread Writing a better Modern::Perl

If your shop's guidelines stated "Support versions of Perl that are older than 5 years old are a time sink.", that would make more sense than simply requiring the version to be stated. You'd see me start putting the following in my files:

BEGIN { die "Unsupported version of Perl\n" if $] >= 5.000000 }

What you suggest is a bad standard as it requires a waste of time to determine the supported version of Perl when that is of no consequence.


Comment on Re^7: Writing a better Modern::Perl
Download Code
Re^8: Writing a better Modern::Perl
by chromatic (Archbishop) on Oct 08, 2010 at 21:31 UTC
    What you suggest is a bad standard as it requires a waste of time to determine the supported version of Perl when that is of no consequence.

    I'd like to think a decent Perl 5 programmer has some idea of the version of the language to which he or she programs. If you can only deploy to 5.008, write use 5.008; at the start of all of your programs and no one will be tempted to use defined-or or state or given/when, whereas if you want to use any of those features, you'd better specify the language version.

    Let's stop pretending there aren't mildly incompatible versions of Perl 5 The Language. feature has taken away that fiction.

      I'd much rather authors didn't specify use 5.010; when they've used say or //.

      Why? Because if they omit it, I get a useful error message telling what is wrong and where, when I try to run it on an earlier version..

      That encourages me to go look at it. And it it is as trivial as replacing say ...; with print ..., "\n", then I can do so, and hey presto; I'm good to go.

      Whereas, if if the compiler dies with:

      Perl v5.X.0 required--this is only v5.Y.yy, stopped. BEGIN failed--compilation aborted.

      I'm quite likely to assume the worst and abandon the attempt.

      Of course, you're going to say that it's trivial to comment it out and see the error messages and decide whether to correct the problem.

      But if it wasn't there in the &^^%$ first place, I wouldn't have to comment it out. Nor make the decision to investigate further!

      Any errors that will arise as a result of the use 'features' from a later version, will manifest themselves very readily. If not the first time you run the code, then at least during your ever-so-thorough pre-production testing.

      So, the only people "protected" by requiring a particular version of perl, are those people dumb enough to download a script or module, and put it straight into production without testing it, or at least running it once, first.

      Surely to dog, they are the very last people we should be protecting--against themselves--when it is to the detriment of the rest of the community.

      That's as bad as the system the means that all the world has to suffer tea & coffee made with non-boiling water (95°), because some dumb-ass went to a drive-thru and placed a cup of coffee between their legs, drove off and scalded their crotch.

      This is yet another of those dumb ideas that sounds cool--until you apply the merest modicum of $%&^*&(* logic to it.

      Just as bad as test tools that hide the real errors and locations and replace them with never-mind-the-quality-feel-width bean counting statistics.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      I'd like to think a decent Perl 5 programmer has some idea of the version of the language to which he or she programs

      I only started with 5.6.1, so I don't know how much further back my code works.

      if you want to use any of those features, you'd better specify the language version.

      I request the appropriate features. I leaves the job of the Perl version to the makefile.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-09-24 03:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (245 votes), past polls