|P is for Practical|
Understanding using external program databy NovMonk (Chaplain)
|on Feb 14, 2007 at 15:59 UTC||Need Help??|
NovMonk has asked for the wisdom of the Perl Monks concerning the following question:
I've read the chapters on this in Beginning Perl and some of the tutorials on this site, but I'm just not getting it. I need to use an external file as a lookup table. It's a simple hash. No subroutines, just the hash. When I turn Off "use strict;" in my main program, it runs and returns values for me. But not using strict is Bad and Evil and I want to do this right. More importantly, I want to understand why it's right and where I can go to read more until the light does come on. Looking at the examples I can find, they all seem to be Object Oriented, focusing on using subroutines, and much more complex than this simple thing I'm trying to do.
Here's my program:
And my lookup.pm:
The error I get when I turn strict on in the main program is this:
I believe it has something to do with how I'm not exporting the information correctly, but as I said, the only examples I find are for exporting subroutines, not a hash by itself. Having the lines above commented in or out makes no difference to how the program runs, with or without strict.
Thanking you in advance for leading me back to the right path,