develooper Front page | perl.par | Postings from October 2006

bugs somewhere, not sure where: Perl? PAR? Image::Info::JPEG? All3?

Thread Next
From:
Glenn Linderman
Date:
October 24, 2006 14:05
Subject:
bugs somewhere, not sure where: Perl? PAR? Image::Info::JPEG? All3?
Message ID:
453E7FF7.7090307@NevCal.com
test.pl script as follows, has been reduced from a larger program in 
which Image::Info::JPEG fails when included in a PAR pp packed 
executable program.  Let me know if any of these issues should be raised 
in a different forum.

#!perl -w
use strict;
use warnings;

my $data = "zyabcdefghijklmnopqrstwxyz";
my ( $fh, $buf );

open ( $fh, "<", \$data )  or  die "can't open string fh: $!";

my $ret = read( $fh, $buf, 4 );
print "ret=$ret  buf=$buf\n";
__END__

As is, it works as I would expect:

d:\MY\PERL\src>test.pl
ret=4  buf=zyab

First mystery: why is PerlIO required, and why isn't the requirement 
autodetected and included?

d:\MY\PERL\src>pp --output test.exe test.pl

d:\MY\PERL\src>test.exe
Can't locate PerlIO.pm in @INC (@INC contains: 
d:\temp\par-glenn\cache-6d3a9211aedc329b4da0bb2b0cc059a47cfc39db/inc/lib 
d:\temp\par-glenn\cache-6d3a9211aedc329b4da0bb2b0cc059a47cfc39db/inc 
CODE(0xe3c75c) . CODE(0xe3c87c)) at script/test.pl line 8.
BEGIN failed--compilation aborted.


Second mystery: after adding -M PerlIO, why does the open fail?

d:\MY\PERL\src>pp -M PerlIO --output test.exe test.pl

d:\MY\PERL\src>test.exe
can't open string fh: No such file or directory at script/test.pl line 8.


-- 
Glenn -- http://nevcal.com/
===========================
A protocol is complete when there is nothing left to remove.
-- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About