I use it like this ( checking program options ):

my $usage = "$0 -s <servdata> -u <userdata> -b <begtime> -e <endtime> -f
<params>\n";
my %opts;
getopts('b:e:s:u:f:', \%opts);

my $servdata = $opts{s};
my $userdata = $opts{u};
my $begtime = $opts{b};
my $endtime = $opts{e};
my $reqdata = $opts{f};

Cheers,
Ela

> -----Ursprüngliche Nachricht-----
> Von: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 27. Juni 2001 16:24
> An: Perl Beginners
> Betreff: getopt:std questions
> 
> 
> Hello everyone,
> 
> Here's a section of code:
> my %options;
> my $u;
> use strict;
> use Getopt::Std;
> 
> getopts("dwmyau:", \%options);
> 
> How can I get the value of the '-u' option and print it to the screen?
> 
> I've tried this:
> $u = $options{u};
> print "$u";
> but that doesn't work...it doesn't print anything.  Can 
> anybody shed some
> light on this for me?
> 
> Thanks,
> Tyler Longren
> 
> 

Reply via email to