in reply to Can't use an undefined value as a symbol reference with mod_perl

<shot in the dark>
Try the code:
my $pdf = PDF::Labels->new( $PDF::Labels::PageFormats[0], filename=>'files/labels.pdf', );
Not quite sure why this might happen, but the error condition is saying that perl thinks you are trying to use something as a filehandle that doesn't have a value.
</shot in the dark>

It's also possible that the actual error is happening in the PDF::Labels new routine and someone is croaking it up to the invocation you are seeing. This would make sense, as you are passing in a filename, so maybe an open is failing and someone forgot to test it for success. That failure, in turn, could be due to a permissions problem, which could definitely result in a weird inconsistency between CGI and mod_perl.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Can't use an undefined value as a symbol reference with mod_perl
by nysus (Parson) on Sep 24, 2015 at 15:53 UTC
    OK, I changed the path to start from the root directory and that fixed the problem. So instead of files/labels.pdf I'm using /var/www/vt/files/labels.pdf. Thanks!

      That's a pathing problem rather than a permissions problem. It's probably worth figuring out what the mod_perl working directory is. Cwd


      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.