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

Re: Creating Variables Just to Pass into Subroutine?

by GotToBTru (Prior)
on Jul 21, 2015 at 20:42 UTC ( [id://1135713]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-18 00:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found