in reply to Re: Tutorial on making a proper module?
in thread Tutorial on making a proper module?
That tutorial is very good, thanks a lot for that. I will definitely follow it.
I have one specific question about the templates thing still unanswered though. Say I have a module like this, and there's an essential file right there in the same directory as TestModule.pm
package TestModule; open( FILE, '<', 'essential_file.txt' ) or die("Can't open file"); 1;
and I run it like this:
require TestModule; print "hello world";
It will fail (unless the script is in the same directory as TestModule).
I'm probably missing something obvious but how do I get the file path right so that TestModule.pm can find its file, no matter where it's called from?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Tutorial on making a proper module?
by Anonymous Monk on Jan 14, 2016 at 04:39 UTC | |
by choroba (Cardinal) on Jan 14, 2016 at 09:56 UTC | |
by Anonymous Monk on Jan 14, 2016 at 10:16 UTC | |
by Cody Fendant (Hermit) on Jan 14, 2016 at 06:13 UTC |