in reply to Re: Re: Passing switches through pl2bat scripts
in thread Passing switches through pl2bat scripts
Try running this:getopt('oDI'); # -o, -D & -I take arg. Sets $opt_* as a side e +ffect. getopt('oDI', \%opts); # -o, -D & -I take arg. Values in %opts
you get some interesting results#!perl use Getopt::Std; my %opts = (); getopt('z', \%opts); for (keys %opts) { print '$opts{', $_, '} = "', $opts{$_}, "\"\n"; }
C:\myperl\temp>perl temp.pl -z $opts{z} = "" C:\myperl\temp>perl temp.pl -y $opts{y} = "1" C:\myperl\temp>perl temp.pl -y -z $opts{y} = "1" $opts{z} = "" C:\myperl\temp>perl temp.pl -z -y $opts{z} = "-y" C:\myperl\temp>temp -z -z $opts{z} = "-z"
--
flounder
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re:^3 Passing switches through pl2bat scripts
by demerphq (Chancellor) on Nov 17, 2003 at 18:02 UTC |