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

Re: problem in loop break

by bliako (Monsignor)
on Dec 01, 2020 at 19:17 UTC ( [id://11124468]=note: print w/replies, xml ) Need Help??


in reply to problem in loop break

if (shapcs($MyIP , $MyUser , $MyPass , $MyPass2 , $com +mand1)) { print shapcs($MyIP , $MyUser , $MyPass , $MyPass2 +, $command1) , "\n" ; }

That's really bad (sorry for being harsh). You execute the command twice if successful. Consider saving the return code of shapcs() somewhere and THEN check if it was success and print messages appropriately.

Note that shapcs() can fail in a number of ways which ideally must all be checked and appropriate error codes be returned so that the caller knows exactly what went wrong and not just blame "Authentication Failed" which is only 1 of the error cases.

bw, bliako

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found