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