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

Re: CLI and problems

by mattriff (Chaplain)
on Aug 17, 2003 at 16:11 UTC ( [id://284423]=note: print w/replies, xml ) Need Help??


in reply to CLI and problems

Does getparam() have function specific arguments? If not, call it once in execCommand(), and have it pass the results to the subroutines being called.

That way, if it fails you can print your error and return to the while loop immediately.

For that matter, you could have getParam() itself print warnings on error, put it in the while loop, and not even call execCommand() if it fails.

On a side-note, if 0 is always a failure, you can replace your if statements with:

&getParam() or return 0;

That's nicer to look at IMO, but TIMTOWDI and YMMV. :)

- Matt Riffle
  Sr. Systems Programmer, pair Networks, Inc.
  (although, I'm speaking only for myself; code is untested unless otherwise stated)

Log In?
Username:
Password:

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

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

    No recent polls found