Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: help with perl variables

by AnomalousMonk (Archbishop)
on Sep 03, 2015 at 05:40 UTC ( [id://1140864]=note: print w/replies, xml ) Need Help??


in reply to Re: help with perl variables
in thread help with perl variables

my $CONNECTCOMMAND1 = "$SSHCOMMAND -ssh $USERNAME1\@$HOST1 -pw $PASSWORD1";
push (@CONNECTCOMMANDS, "$CONNECTCOMMAND1");

Furthermore, the idiomatic tic of stringizing something that is already a string, e.g., "$CONNECTCOMMAND1", while it does no harm, also serves no purpose except to be reliably irritating.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^3: help with perl variables
by davido (Cardinal) on Sep 03, 2015 at 14:54 UTC

    Indeed.

    Just a few days ago I found myself working with code that did just that, and I had to spend a little time tracing through possible reasons why the original coder would have done that.

    If you're going to stringify a scalar that holds a numeric value by wrapping it in quotes, please document that's the reason so that others don't have to wonder if it was intentional. And if that's not the reason, just don't do it. It wastes people's time, wastes a few cycles, clutters the code, clutters its meaning, and drives pedants like me crazy.

    In the case of the code I was looking at, it served no purpose. In the case of this OP, it serves no purpose either.


    Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found