Re: Error when LWP, WxPerl and version.pm are used together
"Octavian Rasnita" <[email protected]> Mon, 6 Dec 2010 13:28:22 +0200
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <DC8C7E6F95A24678B731A971427D6C48@teddy> |
From: "John Peacock" <[email protected]> ... >> - instead of "use version;" I use "use version();". > > The sole difference between those two call is the former implicitly > calls the version::import. And there are only two methods exported by > default: qv() and UNIVERSAL::VERSION. As you can guess by the name, the > latter is exported into the UNIVERSAL namespace (and is required to add > a version-aware fallback comparison method). I've seen that if I redefine UNIVERSAL::VERSION, the program also works fine: sub UNIVERSAL::VERSION {} > You are reporting two problems, but only giving details for one. I'm > guessing that you are saying that if you add REST::Google::Translate, > its own 'use version' is what is causing _your_ script to fail. If I am > not understanding you, please clarify. Yes, the problem appears because REST::Google::Translate and its parent REST::Google use "use version". > It would help me a lot if you could uninstall the newer version.pm and see if you still get an > error in your test script with "use version;" included (since that is > essentially a no-op with Perl 5.10.x and above). I made those tests after installing the latest version of version.pm from CPAN. The program works fine without any other changes if either I add "use IO::Socket" as Mark Dootson suggested, or if I redefine UNIVERSAL::VERSION. It is strange why that error doesn't appear when I use the English locale with Wx::Locale but it appears if I use the Romanian locale code. Thanks. Octavian