Re: do is not working?
- Octavian Rasnita wrote:
> I have tried the following test script under mod_perl usingperldoc -f do
> ModPerl::Registry handler:
> use strict;
> use warnings;
> my $m = do "/usr/local/intranet/site/modules/markets.ini";
> use Data::Dumper;
> print Dumper $m;
> The program prints "$VAR1 = undef;" if I run the program running mod_perl.
> It prints fine the hash if I run it from command line.
> The file "markets.ini" is:
> 'var1' => 'value1',
> 'var2' => 'value2',
> 'var3' => 'value3',
> Do you have any idea what is wrong?
If "do" cannot read the file, it returns undef and sets
the error. If "do" can read the file but cannot compile
returns undef and sets an error message in $@. If the
successfully compiled, "do" returns the value of the last
So I imagine its permissions vs. environment :)
Without error checking its hard to say, try what perldoc -f do says to
do to get the status.