floyd has asked for the wisdom of the Perl Monks concerning the following question:
I'm playing around with packages and modules for the first time and I'm trying to 'import' a path (as a variable) into a package but just don't seem to be able to get the hang of it.
Imagine if you will the following...
script.cgi <---This ties everything together.
variables.pl <---This defines the variables.
package.pl <---The package I'm using.
data.dat <---A data file that I want to read from package.pl
Now, script.cgi accesses variables.pl and gets the path to data.dat "/path/to/datafiles". Script then tells package.pl to access data.dat but package.pl is 'forgetting' what /path/to/datafiles is!
I'm assuming it is possible to make package.pl 'remember' what variables.pl is telling it, but I just can't seem to find the right combination of code to achieve this.
Hopefully someone out there knows?
Thanks
Floyd
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using variables within packages
by nite_man (Deacon) on May 07, 2003 at 16:47 UTC | |
by floyd (Acolyte) on May 09, 2003 at 16:07 UTC | |
|
Re: Using variables within packages
by Maddingue (Sexton) on May 07, 2003 at 16:47 UTC | |
|
Re: Using variables within packages
by tcf22 (Priest) on May 07, 2003 at 16:55 UTC | |
by floyd (Acolyte) on May 07, 2003 at 17:08 UTC | |
by tcf22 (Priest) on May 07, 2003 at 17:13 UTC | |
by floyd (Acolyte) on May 07, 2003 at 17:21 UTC | |
|
Re: Using variables within packages
by Coplan (Pilgrim) on May 07, 2003 at 16:31 UTC | |
by floyd (Acolyte) on May 07, 2003 at 17:05 UTC |