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

Re: Testing for filehandles

Thread Previous | Thread Next
From:
eric-perl
Date:
March 27, 2002 13:59
Subject:
Re: Testing for filehandles
Message ID:
Pine.LNX.4.33.0203271252380.20427-100000@lucy
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}.

Agustin:

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
       specified.

-- 
Eric P.
Los Gatos, CA


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About