Randal L. Schwartz wrote:
"M" == M Lewis <[EMAIL PROTECTED]> writes:M> do '/absolute/path/to/mcr.conf'; M> Which defeats my purpose of getting the configuration items out of the M> scripts themselves. I don't want the users to have to edit the three M> scripts, only the mcr.conf file. If your configs are relative to the file itself, consider that __FILE__ is the name of the current file, *when* compiled. So, if you have to pull in an additional file that's in the same directory as your module or script, just add: BEGIN { use File::Spec; my @place = File::Spec->splitpath(__FILE__); $place[-1] = "config.pl"; require File::Spec->catpath(@place); } This guarantees to bring in a file named config.pl in the same directory as your script (if used from the main program) or the .pm file if used from the module. A simpler version is like this: BEGIN { require __FILE__ . "-config.pl"; } which makes the config file "fred-config.pl" for a program named fred, or "fred.pm-config.pl" for the fred.pm module. If your OS can handle funky names like that, you're golden.
Interesting. Thanks much Randal. I will experiment with this also. Thanks, Mike -- Don't compare floating point numbers solely for equality. 00:50:01 up 6 days, 19:40, 5 users, load average: 0.03, 0.26, 0.31 Linux Registered User #241685 http://counter.li.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
