Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Can't use undefined value as an ARRAY reference

by PilotinControl (Pilgrim)
on Mar 15, 2014 at 17:15 UTC ( [id://1078469]=note: print w/replies, xml ) Need Help??


in reply to Re: Can't use undefined value as an ARRAY reference
in thread Can't use undefined value as an ARRAY reference

Below are the particulars:
Computer 1: WinXP, Perl 5.10.0 Activestate, PDF-Reuse v35
Computer 2: Win7, Perl 5.16.3 Activestate, PDF-Reuse v35
Modules were installed using a mixture of PPM and CPAN

WINXP REUSE PM UN EDITED $stream = ''; my $tSida = $sida + 1; if ((@annots) || (defined @{$links{'-1'}}) || (defined @{$links{$tSida}})) { $sidObjekt .= '/Annots ' . mergeLinks() . ' 0 R'; } if (defined $AAPageSaved) { $sidObjekt .= "/AA $AAPageSaved"; undef $AAPageSaved; } $sidObjekt .= ">>endobj\n"; $objekt[$sidObjNr] = $pos; $pos += syswrite UTFIL, $sidObjekt; push @{$kids[0]}, $sidObjNr; $sida++; $counts[0]++; if ($counts[0] > 9) { ordnaNoder(8); } } sub prEnd { if (! $pos) { return; } if ($stream) { skrivSida(); } skrivUtNoder(); if($docProxy) { $docProxy->write_objects; undef $docProxy; # Break circular refs }

Windows 7 code edited using a suggestion from a fellow monk which fixed the error regarding a symbol reference.

$stream = ''; my $tSida = $sida + 1; #if ((@annots) #|| (defined @{$links{'-1'}}) #|| (defined @{$links{$tSida}})) if(@annots || @{$links{'-1'}} || @{links{$tSida}} ) # LINE 995 { $sidObjekt .= '/Annots ' . mergeLinks() . ' 0 R'; } if (defined $AAPageSaved) { $sidObjekt .= "/AA $AAPageSaved"; undef $AAPageSaved; } $sidObjekt .= ">>endobj\n"; $objekt[$sidObjNr] = $pos; $pos += syswrite UTFIL, $sidObjekt; push @{$kids[0]}, $sidObjNr; $sida++; $counts[0]++; if ($counts[0] > 9) { ordnaNoder(8); } } sub prEnd { if (! $pos) { return; } if ($stream) # LINE 1017 { skrivSida(); } skrivUtNoder(); if($docProxy) { $docProxy->write_objects; undef $docProxy; # Break circular refs }

And here is the code that is used to callback to the Reuse.pm in the script:

prEnd;

Replies are listed 'Best First'.
Re^3: Can't use undefined value as an ARRAY reference
by davido (Cardinal) on Mar 15, 2014 at 17:51 UTC

    So your Perl version is different, for one thing. And you're installing it using a combination of PPM and cpan... seems odd. And you've modified the source code of the module, possibly without fully understanding what the modification is for. Those are at least three opportunities for trouble to creep in, without even considering the potential for bugs within the module itself.

    Speaking of which, I found this: RT#77800, which deals specifically with a problem that turns up under Perl 5.16.x and newer, relating to deprecation warnings... not the same type of warning you're getting, but definitely within the same code segment.

    I don't know the answer to the question I'm about to ask, because I do my best to avoid working with PDF's: Is it possible that there is a newer, better maintained module on CPAN that can be of use to you, that doesn't have bugs in its queue that are --in some cases-- several years old?

    Anyway, try rolling your Perl version back to an earlier version -- preferably the same version you're using on the old Windows machine -- and see if it works then. If so, you've found another bug to report, though I don't think anyone is monitoring the reports at this point.

    It sounds like you're using ActiveState. It appears that Perl-5.10.x is available from ActiveState for a fee. You might, instead, download the Strawberry Perl Perl v5.10.1 in a sandboxed dev environment and see if the module works under that Perl. If so, and if you still are required to use ActivePerl in production, you'll at least know whether or not its worthwhile investigating what ActiveState charges for 5.10.


    Dave

      I may have no choice than to backdate to Perl v5.10.0 as that version and everything works fine on WinXP. I had to use a mixture of PPM, CPAN, and Bribes as v5.10.0 gives that Authorization failed from Activestate with older versions of Perl when trying to download packages via PPM.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1078469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found