in reply to Re: Sharing Getopts::Std amongst several related scripts
in thread Sharing Getopts::Std amongst several related scripts
I've changed the code in my library to look like so:
and in the script that requires the library, I have:{ package OPTS; use Getopt::Std; our %opts; getopts('fs', \%opts); }
and it all seems to work now the way I want it to. Although I'm still not really sure I fully understand what's going on here. I've just been flicking through Chapter 10 (Packages) in my trusty Camel Book. I think I need to study it some more before I get the hang of this.our %opts; *opts = \%OPTS::opts; if ($OPTS::opts{f}) { #do stuff }
But thanks again :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sharing Getopts::Std amongst several related scripts
by ikegami (Patriarch) on Dec 13, 2005 at 17:31 UTC |