Kjetil Kjernsmo schrieb: > On Tuesday 19 September 2006 16:30, Michael Peters wrote: >>> URI.pm location: /usr/lib/perl5/Apache2/URI.pm >>> Can't locate object method "new" via package "URI" at [blah] >> That's Apache2::URI, not URI. > > Duh! I'm bliiiiind! :-) > >> What does the command line version of >> that same script print? > > URI.pm location: /usr/share/perl5/URI.pm > > which is the right thing, I guess. That is, they are not the same > script, since the online version has a lot of stuff around it, but the > code does the same thing. > >> Do you have "/usr/lib/perl5/Apache2" in your >> @INC? If so, you shouldn't (I believe that was an old 1.99 thing >> before the change into the Apache2 namespace). > > Huh? Yes, I have that, but that is the correct namespace, isn't it? >
Not that is not OK. If you have: @INC = qw(/usr/lib/perl5/Apache2,/usr/share/perl5/,); - /usr/lib/perl5/Apache2/URI.pm - /usr/lib/URI.pm and you have code code like this: use URI; It will load the wrong URI namely the one in path found first (like it works on all *ix systems)! Do you have an old mp2 installation on your system? I think the @INC-modification is done by loading Apache2.pm which modifies @INC, remove that its not needed any more! Tom > Also, the code says: > > package Apache2::URI; > [snip] > use Apache2::XSLoader (); > our $VERSION = '2.000002'; > > so it seems to be the correct version? > > But yeah, I think it looks like we have the culprit here, but why does > it load Apache2::URI when use-ing URI rather than URI...? >