Don't ask to ask, just ask | |
PerlMonks |
Re: CLI and problemsby mattriff (Chaplain) |
on Aug 17, 2003 at 16:11 UTC ( [id://284423]=note: print w/replies, xml ) | Need Help?? |
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:
That's nicer to look at IMO, but TIMTOWDI and YMMV. :)
- Matt Riffle
In Section
Seekers of Perl Wisdom
|
|