Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: subroutine For ssh

by Fletch (Bishop)
on Oct 09, 2019 at 13:34 UTC ( #11107245=note: print w/replies, xml ) Need Help??


in reply to Re: subroutine For ssh
in thread subroutine For ssh

Couple of style nits:

It's not necessary to requote everything as you've done in several places (e.g. "$MyUser" or "$command"). It's extra, unneeded visual noise and (in weird corner cases) could trigger behavior you don't intend (quoting something which has stringification overloaded; alternately if down the road the underlying API expects a HASHREF for an argument where it used to expect a SCALAR you've now got to go through and remove them).

And more of a personal preference but WRT your variable naming, the "My" prefix on everything doesn't really gain you anything. Were you to keep it it's more common to use lowercase underscore delimited local lexical variable names rather than CamelCase (e.g. $unprivileged_password or $privileged_password might be better than $MyPass and $MyPass2).

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2023-09-21 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?