Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

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.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

        Use 5.12.4; is a habit. Nothing more. I usually do use features like `say`...
        --perl.j

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2014-12-19 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (83 votes), past polls