From: Francesco <[EMAIL PROTECTED]>
> Jenda Krynicky ha scritto:
> > Put something like this on top of the script:
> >
> > BEGIN {
> > push @INC, sub {print STDERR "Still looking for $_[1]\n";exit;};
> > }
> >
> >
> I tried this and I got the following output
>
> Still looking for Encode/ConfigLocal.pm
>
> also if the modules were all installed.
> Moreover, it works fine if I insert a non existent module: e.g. I put as
> first required module:
> use Tk2;
> and, correctly, your sulution says:
> Still looking for Tk2.pm
>
> Could you explain to me what exactly your code does and why he looks for
> Encode/ConfigLocal.pm ?
Encode looks for the module. And proceedes even without it.
If I change that code to
BEGIN {
push @INC, sub {die "Still looking for $_[1]\n";};
}
use Encode;
use Bleargh;
I get
Still looking for Bleargh.pm
BEGIN failed--compilation aborted at C:\temp\zkUse.pl line 7.
It's the "BEGIN failed" that I wanted to get rid of with the print
STDERR ...; exit;.
Looks like this works right:
BEGIN {
push @INC, sub {return if $^S; print STDERR "Still looking for
$_[1]\n";exit;};
}
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/