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

Re^3: Rewrite Program Using Arrays

by Jenda (Abbot)
on Mar 26, 2012 at 09:45 UTC ( #961636=note: print w/replies, xml ) Need Help??

in reply to Re^2: Rewrite Program Using Arrays
in thread Rewrite Program Using Arrays

In that case I'd prefer to see that in the documentation or a comment. By "using" a version number you are not merely saying "I've tested this only with this particular version." What you are effectively saying is more like "I believe this will not work with anything older than X."

If I see "use 5.12.4;" I assume there was something wrong with even 5.12.3, something that prevents the code to work correctly. So probably I would not bother trying to run it under 5.10.x. On the other hand with a comment about the version tested under, I would try it and only if I end up getting an error I'd take the possible version differences into account.

Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^4: Rewrite Program Using Arrays
by chromatic (Archbishop) on Mar 26, 2012 at 16:14 UTC

    You're also documenting to Perl what you expect.

    Remember that much of the difficulty of parsing Perl 5 (and enhancing Perl 5) is that you can only guess as to which features of Perl 5 you expect in any given file without an explicit version declaration. Sure, feature enables keywords, but you also get different semantics in 5.12 and 5.14, for example, with the use of unicode_strings.

    With that said, use 5.12.4; has disadvantages compared to use 5.012;.

Re^4: Rewrite Program Using Arrays
by perl.j (Pilgrim) on Mar 26, 2012 at 10:23 UTC
    Use 5.12.4; is a habit. Nothing more. I usually do use features like `say`...
      That's why I default to 5.10.0. I just can't see the benefit of requiring 5.12.4. Even if were really keen on 5.12 features, I'd use use 5.012;. The only time I would write use 5.12.4; if the program needs a bugfix that happened between 5.12.3 and 5.12.4.
        It's something my teacher did, so I kind of copied. If I ever use a newer version of Perl, I will write 5.x.x

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2023-09-29 23:03 GMT
Find Nodes?
    Voting Booth?

    No recent polls found