Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Installation Problem with XML::Parser perl module

Reply
Thread Tools

Installation Problem with XML::Parser perl module

 
 
HarishN
Guest
Posts: n/a
 
      02-20-2004
I just installed the XML:arser and when I tried to run a test I see
this following error.
Parser.pm and Expat.pm versions don't match at
/my/local/harishn/perl-modules/lib/5.6.1/sun4-solaris/XML/Parser.pm
line 16.

I looked at the source code in these 2 modules.

package XML:arser;

use Carp;

BEGIN {
require XML:arser::Expat;
$VERSION = '2.34';
die "Parser.pm and Expat.pm versions don't match"
unless $VERSION eq $XML:arser::Expat::VERSION;
}

package XML:arser::Expat;

require 5.004;

use strict;
use vars qw($VERSION @ISA %Handler_Setters %Encoding_Table
@Encoding_Path
$have_File_Spec);
use Carp;

require DynaLoader;

@ISA = qw(DynaLoader);
$VERSION = "2.34" ;


I see both versions match but I still get the error. Can you anyone
help in resolving this ?


Thank you very much,
Harish
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      02-21-2004

(HarishN) wrote:
> I just installed the XML:arser and when I tried to run a test I see
> this following error.
> Parser.pm and Expat.pm versions don't match at
> /my/local/harishn/perl-modules/lib/5.6.1/sun4-solaris/XML/Parser.pm
> line 16.
>
> I looked at the source code in these 2 modules.
>
> package XML:arser;
>
> $VERSION = '2.34';
>
> package XML:arser::Expat;
>
> $VERSION = "2.34" ;
>
> I see both versions match but I still get the error. Can you anyone
> help in resolving this ?


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.

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/' #
 
Reply With Quote
 
 
 
 
Anno Siegel
Guest
Posts: n/a
 
      02-22-2004
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. Did you mean to eval() something? Otherwise, $@ is useless.

Adapting things a bit, I came up with

BEGIN {
$SIG{__DIE__} = sub {
die "MyLib is $INC{ 'MyLib.pm'}\n" . shift;
}
}

use MyLib;

However, the sub is called tree times (accumulating identical messages)
when MyLib dies. I don't understand that offhand.

Anno
 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      02-22-2004

(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/' #
 
Reply With Quote
 
Anno Siegel
Guest
Posts: n/a
 
      02-23-2004
Ben Morrow <> wrote in comp.lang.perl.misc:
>
> (Anno Siegel) wrote:
> > Ben Morrow <> wrote in comp.lang.perl.misc:


[...]

> > > 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:


You're right. Sorry for the false alarm.

Anno
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
query regarding perl module installation in local directory contactviswa@gmail.com Perl Misc 1 07-28-2007 08:22 PM
DB Module installation issue in Perl Pioneer Perl Misc 0 04-21-2007 11:28 PM
perl cgi session module installation problem. bhuvana.aradhya@gmail.com Perl Misc 0 06-05-2006 01:31 PM
New Perl installation can't find module JONL Perl Misc 12 04-12-2005 12:01 PM
Installation of a perl module mistletoe Perl Misc 5 11-13-2003 01:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57