
rGeoffrey
User
Nov 13, 2001, 1:11 PM
Post #2 of 5
(841 views)
|
|
Re: Modules + Import Parameters
[In reply to]
|
Can't Post
|
|
This should work...
package Some::Module; BEGIN{ use Exporter (); use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.10; @ISA = qw (Exporter); @EXPORT = qw ( ); use vars qw ($FILENAME ); } And then you call it with these two lines...
use Some::Module; $Some::Module::FILENAME = 'some/file/name/here.txt'; So $FILENAME is a package variable inside Some::Module, but it can be changed from outside. This will slow down anyone who wants to try to change or even use $FILENAME from outside Some::Module, but you can still set it from outside. Remember that you will not be able to use local or my on $FILENAME if you want to deal with it from outside the file.
|