in reply to Re: Begining Monk seeks Wisdom.......
in thread Begining Monk seeks Wisdom.......
Yes, you're missing a bracket at the end of the line. :-) Syntax errors aside (use the -w switch to avoid the problem jeroenes pointed out), I don't think anything's wrong with what you wrote, in principle. I can't get Getopt::Std::getopt() to work either (I'm not sure what's up with that--possibly we're both idiots), but if you use getopts() (note the s) instead, it should work (assuming, of course, that your syntax checks out otherwise ;-).
If you like use strict; (and you should), try the two-argument syntax that azatoth mentions (check the docs for how), so you don't have to declare a variable for every switch.
Update:
I got so excited about getopt that I forgot the main point: check the return value of the whichever function you use to see if it's failing (returns a true value if it works normally).
Correction: <blush>
only check the return value of getopts(), getopt() always returns false.
Update 2:
The source of your original problem was probably that getopt() expects all flags to have arguments (e.g. -e1 or -e 1), not be booleans (-e): getopts() allows for both. Which I should have pointed out earlier, sorry.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Begining Monk seeks Wisdom.......
by void (Scribe) on May 04, 2001 at 19:45 UTC |