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

2006-10-25 Thread Roderich Schupp

On 10/25/06, Steffen Mueller [EMAIL PROTECTED] wrote:

 open ( $fh, , \$data )  or  die can't open string fh: $!;
[...]

That's the culprit!

I explained this in detail in
https://rt.cpan.org/Public/Bug/Display.html?id=11108


I concur that Module::ScanDeps can't statically detect whether a given
invocation
of open would require PerlIO. One could argue that it should always assume so,
but that would mean packing  the whole PerlIO into almost every pp'ex
executable.

On the other hand, Glenn tried packing with

pp -M PerlIO ...

which is failry reasonable when seeing Can't locate PerlIO.pm errors.
But that didn't work either, because it doesn't pick up PerlIO::scalar.
One could add something like

   'PerlIO.pm' = sub {
   _glob_in_inc('PerlIO', 1),

to Module::ScanDeps %Preload table (i.e. for PerlIO.pm also pick up recursively
anything below .../PerlIO). When I added this this,

scandeps.pl -B 'use PerlIO;'

prints the right thing, but this discovered another bug (or
inconsistency at least):

pp -e 'use PerlIO; ...'

now includes all PerlIO::* stuff, while

pp -M PerlIO -e '...'

does not (inlcudes PerlIO.pm only) (using Module::Scandeps 0.66).

Cheers, Roderich


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

2006-10-25 Thread Steffen Mueller

Roderich Schupp schrieb:
[...]

On the other hand, Glenn tried packing with

pp -M PerlIO ...

which is failry reasonable when seeing Can't locate PerlIO.pm errors.
But that didn't work either, because it doesn't pick up PerlIO::scalar.
One could add something like

   'PerlIO.pm' = sub {
   _glob_in_inc('PerlIO', 1),

to Module::ScanDeps %Preload table (i.e. for PerlIO.pm also pick up 
recursively

anything below .../PerlIO). When I added this this,

scandeps.pl -B 'use PerlIO;'

prints the right thing, [...]


As I found out by talking to Nicholas and Rafael, PerlIO::scalar is the 
only PerlIO layer which is loaded magically, that is, without specific 
request:


open FOO, ':raw', 'filename'

would load PerlIO::raw. If you packaged this and PerlIO::raw couldn't be 
found during subsequent execution of the binary, you would get a warning 
about a missing PerlIO layer as follows:


Unknown PerlIO layer raw at -e line 1.

Whereas we're observing the case where :scalar is appended implicitly:

open FOO, '', \$scalar;

This *doesn't* trigger a warning if PerlIO::scalar isn't available which 
wasn't discovered because it's always available with a normal perl 5.8. 
Rafael fixed this for 5.9/10.


Now, we could add a Preload entry for all PerlIO layers if PerlIO is 
explicitly requested or we could add one for just PerlIO::scalar because 
that's the only one which will be automagically loaded by core perl.


A bit further out, it would be feasible to try to find PerlIO usage in 
cases like


/open \s* $filehandle_or_scalar_regex \s* , \s* (|') $mode_regex : 
(\w+) \1 \s* ,/


I know. q{} and friends exist. It's fragile. In that way, it fits well 
into Module::ScanDeps. And I'm not going to implement it either.




but this discovered another bug (or
inconsistency at least):

pp -e 'use PerlIO; ...'

now includes all PerlIO::* stuff, while

pp -M PerlIO -e '...'

does not (inlcudes PerlIO.pm only) (using Module::Scandeps 0.66).


At first, I thought modules passed to pp via -M just weren't scanned at 
all, but they are! (pp -M Math::Symbolic -e 'print Hello\n;' packages 
Parse::RecDescent alright.)


I don't know what causes this and don't have the time to investigate. 
Assuming you can't fix this in a minute either, would you consider 
filing a M::SD bug report? Possibly just with this and the patch to 
M::SD for %Preload-ing PerlIO::(scalar|.*).


Steffen


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

2006-10-25 Thread Roderich Schupp

On 10/25/06, Steffen Mueller [EMAIL PROTECTED] wrote:

At first, I thought modules passed to pp via -M just weren't scanned at
all, but they are! (pp -M Math::Symbolic -e 'print Hello\n;' packages
Parse::RecDescent alright.)


Yeah, modules are scanned either way, but the %Preload magic of M::SD
apparently doesn't get applied when using pp -M Foo 
I filed a bug for PAR, since I'm not sure whether it's PAR or M::SD's fault.


filing a M::SD bug report? Possibly just with this and the patch to
M::SD for %Preload-ing PerlIO::(scalar|.*).


Filed that one, too.

BTW, Steffen, thanks for all your work on PAR.

Cheers, Roderich