(Anno Siegel) wrote:
> Ben Morrow <> wrote in comp.lang.perl.misc:
>
> [...]
>
> > Is there another XML/Parser/Expat.pm somewhere in @INC that is getting loaded
> > first?
> >
> > Try adding
> >
> > BEGIN {
> > $SIG{__DIE__} = sub {
> > die <<DIE
> > Parser.pm is $INC{'XML/Parser.pm'}
> > Expat.pm is $INC{'XML/Parser/Expat.pm'}
> > $@
> > DIE
> > }
> > }
> >
> > at the top of your program.
>
> Ugh, that won't work. It's interpolating $INC{ ...} before anything is
> loaded.
Eh? No it's not... $INC{...} is interpolated when the heredoc is
evaluated, not when it's compiled:
~% perl -e'BEGIN { $SIG{__DIE__}=sub{ die <<DIE'
-e'Fcntl is $INC{q/Fcntl.pm/}'
-e'$_[0]'
-e'DIE'
-e'} } use Fcntl qw/foo/'
Fcntl is /usr/lib/perl5/5.8.2/i686-linux-thread-multi/Fcntl.pm
"foo" is not exported by the Fcntl module
Can't continue after import errors at -e line 5
BEGIN failed--compilation aborted at -e line 5.
> Did you mean to eval() something? Otherwise, $@ is useless.
No, that's just me getting $SIG{__DIE__}/$@ confused with END{}/$?...
I meant $_[0], of course.
Ben
--
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/' #