Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^8: Writing a better Modern::Perl

by chromatic (Archbishop)
on Oct 08, 2010 at 21:31 UTC ( #864283=note: print w/replies, xml ) Need Help??

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

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.

Replies are listed 'Best First'.
Re^9: Writing a better Modern::Perl
by BrowserUk (Pope) on Oct 08, 2010 at 22:52 UTC

    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.
Re^9: Writing a better Modern::Perl
by ikegami (Pope) on Oct 09, 2010 at 01:18 UTC

    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://864283]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-03-18 15:34 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (230 votes). Check out past polls.