in reply to Creating Variables Just to Pass into Subroutine?

Are any of them used later in the program? That would be the obvious case for when you would want to use a variable instead of a literal. Otherwise, I tend to agree with you. It does clutter things.

Other advice - if you will be changing these programs, you will want to explore creating tests for them.

Dum Spiro Spero
  • Comment on Re: Creating Variables Just to Pass into Subroutine?

Replies are listed 'Best First'.
Re^2: Creating Variables Just to Pass into Subroutine?
by Monk::Thomas (Friar) on Jul 22, 2015 at 08:58 UTC
    for (0..100) { print "if you will be changing these programs, you will want to expl +ore creating tests for them.\n" }
    ...especially for financial stuff.
Re^2: Creating Variables Just to Pass into Subroutine?
by mdskrzypczyk (Novice) on Jul 22, 2015 at 13:39 UTC
    These are pretty much used only right when calling the subroutine, the Notify subroutine typically occurs at end of the line branches of the file where there are many conditional statements to get there so I don't believe that more than one call to Notify or use of these variables is used in more than one run of the script.