Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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.

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]
[usemodperl]: greetings
[usemodperl]: question
[usemodperl]: perldoc -v 'ARGV' works but perldoc -v "STDIN' does not, but they are both filehandles. is there a perldoc for STDIN?

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-06-19 19:11 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.