Prob with GetOptions

Hello All,
I am writing a script wherein its usage is as follows :
mkelem [-h] [-dir [-rec]] <element name1> <element name2>

Now for this i have used the GetOptions module as follows :
$st = GetOptions("h|help" => \$help,
"dir=s" => \$dir,
"rec" => \$rec);
The script when executed with-dir option followed by an argument should go
to one part of the script as in :
mkelem -dir a b c
And the script executed with option -dir and -rec should do some other part
as in (which doesnt happen):
mkelem -dir -rec a b c
As i am using getopts module with "-dir=s", it is taking the -rec as its
argument and it doesnt consider it as an option (which i think is natural
with "dir=s") .
Also i do not want to use -rec option alone i.e. it is to be used either
with -dir option or not used at all.

Is this possible ???

Regards
Aakash
aakash [ Fr, 16 Februar 2007 07:06 ] [ ID #1639154 ]
Perl » comp.lang.perl.modules » Prob with GetOptions

Vorheriges Thema: how to skip some xml records using XML::SAX parser?
Nächstes Thema: manually expire an element in Memoize (also on comp.lang.perl.misc)