greedyzebra
Technical User
Hi,
I'm wanting to do something that seems as though it should be very simple, but a couple of hours on google and reading through several Perl books has not yielded an answer.
I've created a module. The functions (subs) in it are readily accessible, but variables I intend to be global (accessable by the calling script) are apparently not initialized.
For example, in my .pm file I wish to have the variable $TRUE with the value equal to 1. Whenever I say "use myModule" in a script, I want the be able to type "print $TRUE" in that script (with no other declarations) and have the output be "1".
I've used h2xs to create the shell file for the module. Everything in the module works fine. There are no complaints from the compiler about unknown variables or functions (I've exported everything I wish to be seen). Only complaints, when I try the print statements above, that the value $TRUE is uninitialized.
Please help before I have a stroke
Thanks.
I'm wanting to do something that seems as though it should be very simple, but a couple of hours on google and reading through several Perl books has not yielded an answer.
I've created a module. The functions (subs) in it are readily accessible, but variables I intend to be global (accessable by the calling script) are apparently not initialized.
For example, in my .pm file I wish to have the variable $TRUE with the value equal to 1. Whenever I say "use myModule" in a script, I want the be able to type "print $TRUE" in that script (with no other declarations) and have the output be "1".
I've used h2xs to create the shell file for the module. Everything in the module works fine. There are no complaints from the compiler about unknown variables or functions (I've exported everything I wish to be seen). Only complaints, when I try the print statements above, that the value $TRUE is uninitialized.
Please help before I have a stroke
Thanks.