You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Thomas K. Burkholder" <bu...@dogrobber.com> on 2001/04/17 06:49:46 UTC
Mea Culpa [Was: Re: modperl security model question]
It's defined all right, it gets printed to STDERR.
The problem was that the file I was actually using was a perl file '/tmp/foo.pl', just
because it didn't matter what was in the file while I tried to make it work. But, wait, it
does matter, because the first thing in the file was "use Data::Dump;". Apparently, some
translation that goes on in there turns that string into an execution of it (or something).
It's probably a bug if anyone cares - just use the same example I gave but make sure the
first two lines are "use Data::Dump;" and it should reproduce.
Or am I missing something? Is there a perfectly logical reason why having the $line variable
contain "use Data::Dump;" should result in $line being evaluated to undef a few lines later?
Thanks to those who helped.
//T
darren chamberlain wrote:
> Be sure to check that $line is defined:
>
> Thomas K. Burkholder (burkhold@dogrobber.com) said something to this effect on 04/16/2001:
> > Note, /tmp/tmppswd is read-only by the installer of the product, but I should
> > be root in access.conf (right?) so I should be able to read it anyway.
> >
> > <perl>
> > use IO::File;
> > my $input = IO::File->new("</tmp/tmppswd") || die "Couldn't open /tmp/foo.pl";
> > my $line = $input->getline();
>
> die "\$line is not defined" unless (defined $line);
>
> > print STDERR $line;
> > $input->close();
> > # $line = 'bar';
> > $Location{'/areaj'} = {
> > PerlSetVar => [
> > [foo => $line]
> > ],
> > SetHandler => 'perl-script',
> > PerlHandler => 'AreaJ::AreaJ'
> > }
> > # push @{ $Location{'/areaj'}->{PerlSetVar} }, [foo => $line];
> > </perl>
>
> (darren)
>
> --
> The three most dangerous things are a programmer with a soldering iron,
> a manager who codes, and a user who gets ideas.