[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Omaha.pm] Getopt::Long and opt_ variables
* georgen@neillnet.com (georgen@neillnet.com) wrote:
> <quote from="http://www.perl.com/doc/manual/html/lib/Getopt/Long.html">
> Note that, if your code is running under the recommended use strict 'vars'
> pragma, it may be helpful to declare these package variables via use vars
> perhaps something like this:
>
> use vars qw/ $opt_size @opt_sizes $opt_bar /;
> </quote>
>
> so ... you just need to add,
>
> use vars qw/ $opt_place /;
>
Just need to use 'our'. 'vars' is old skool for 'our' (well for variables
in the current package anyway)
(via "perldoc vars")
NOTE: For variables in the current package, the functionality provided
by this pragma has been superseded by "our" declarations, available in
Perl v5.6.0 or later. See "our" in perlfunc.
These do the same thing...
use vars qw/ $opt_size @opt_sizes $opt_bar /;
our ($opt_size, @opt_sizes, $opt_bar);
> OR
>
> remove the statement,
>
> use strict;
Darth Vader says, "Nooooooooooooooooo!!!" :P
Also its almost generally a very bad idea to remove 'use strict;'
Very bad things are bound to happen without you being the wiser :)
-- Jeff Bisbee / omaha-pm@jbisbee.com / jbisbee.com