Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Rewrite Program Using Arrays

by educated_foo (Vicar)
on Mar 25, 2012 at 18:05 UTC ( #961514=note: print w/ replies, xml ) Need Help??

in reply to Rewrite Program Using Arrays

Why did you put this useless bit of superstition at the top?

use 5.12.4;
One way to likely make your program faster would be to use an older Perl, like 5.6. But your superstition prevents that.

Comment on Re: Rewrite Program Using Arrays
Download Code
Replies are listed 'Best First'.
Re^2: Rewrite Program Using Arrays
by chromatic (Archbishop) on Mar 26, 2012 at 00:46 UTC

    How about to document the version of Perl on which he tested it?

      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.

        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;.

        Use 5.12.4; is a habit. Nothing more. I usually do use features like `say`...
Re^2: Rewrite Program Using Arrays
by Anonymous Monk on Mar 25, 2012 at 19:03 UTC

    say/state/switch, duh

      I don't think the OP is using any of them.

        I don't think the OP is using any of them.

        Well sure, but so what? It doesn't make them useless or superstition.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://961514]
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 2015-11-29 03:59 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls