On Tue, Jul 03, 2001 at 07:13:58PM -0500, [EMAIL PROTECTED] wrote:
> I've read through
> http://search.cpan.org/doc/JHI/perl-5.7.1/lib/Getopt/Std.pm
I wouldn't suggest using this as your reference for core Perl modules. You
should use perldoc on the command-line, or failing that, www.perldoc.com.
The problem is the documentation you find under
http://search.cpan.org/doc/JHI/perl-5.7.1/ is for Perl 5.7.1, which is the
experimental version. Things are likely to change or be somewhat different
from what you're using.
> and it seems as though the following syntax should work:
>
> getopt("nh",\%option);
>
> however, it does not. when i use getopts rather than getopt
>
> getopts("nh",\%option);
>
> it does work. did i misread the cpan page that i referenced?
In what way does getopt not work? What are you getting? What did you
expect?
Example:
perl -MGetopt::Std -we 'getopt("nh", \%opts);
print map { "$_ => $opts{$_}\n" } keys(%opts);' -- -n test -h
Outputs:
n => test
h =>
As I would expect.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--