develooper Front page | perl.beginners | Postings from March 2002

Re: Testing for filehandles

Thread Previous | Thread Next
March 27, 2002 13:59
Re: Testing for filehandles
Message ID:
On 27 Mar 2002, Chas Owens wrote:

> Getopt::Std creates the $opt_n variables.  To use it with use strict; in
> place you must use the use vars ($opt_n); pragma as well.  or just use
> the getopts('n', \%opts); call.  Then you can say $opts{n}.


Also from the Getopt::Std man page:

       For those of you who don't like additional global vari-
       ables being created, getopt() and getopts() will also
       accept a hash reference as an optional second argument.
       Hash keys will be x (where x is the switch name) with key
       values the value of the argument or 1 if no argument is

Eric P.
Los Gatos, CA

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About