Re: Can't locate object method "require_version" by davorg (Chancellor) on Sep 13, 2006 at 12:42 UTC |
perldoc perldiag contains extended explainations of all of Perl's diagnostic messages. Maybe that will help you.
Can you demonstrate a short (<10 line) program that exhibits this behaviour for you?
--
< http://dave.org.uk>
"The first rule of Perl club is you do not talk about
Perl club." -- Chip Salzenberg
| [reply] |
|
The page that you linked me to indicated the following. Please could someone further explain this for me.
Can't locate object method "%s" via package "%s"
(F) You called a method correctly, and it correctly indicated a package functioning as a class, but that package doesn't define that particular method, nor does any of its base classes. See perlobj.
| [reply] |
Re: Can't locate object method "require_version" by marto (Chancellor) on Sep 13, 2006 at 12:45 UTC |
| [reply] |
|
Martin,
I expect that I have not correctly installed DBI. Or there is a compatibility problem with Win XP.
The code in question is:
use DBI;
| [reply] [d/l] |
|
| [reply] |
|
|
|
Win,
Is that all the code you have in this script? I have never had any problems installing DBI on Windows 2000 or XP. Check out Installing Modules if you need help installing modules.
Martin
| [reply] |
|
|
|
|
|
I expect that I have not correctly installed DBI
I expect so, too :-) Assuming you have installed ActivePerl, try entering (while connected to the internet): ppm install DBI
If you get complaints that DBI is already installed then run: ppm remove DBI followed by: ppm install DBI
Cheers, Rob
| [reply] |
|
|
|
|
What version of Perl (perl -v), DBI (perl -MDBI -le "print DBI->VERSION") and Exporter (perl -MExporter -le "print Exporter->VERSION") are you using?
| [reply] [d/l] [select] |
|
|
|
|
Re: Can't locate object method "require_version" by ikegami (Pope) on Sep 13, 2006 at 13:40 UTC |
Sounds like you're missing @ISA = qw( Exporter ); in a module using Exporter. require_version is called by (and provided via inheritance by) Exporter to handle use Module version;
| [reply] [d/l] [select] |
|
| [reply] |
|
You should only see that error if you do something like use DBI 1.50; and if this wasn't supported by DBI. Re^3: Can't locate object method "require_version" was partially a trick question to make sure you weren't doing this.
I looked into DBI and I can't find what would cause this problem. Exporter is loaded, and Exporter is in @DBI::ISA.
Furthermore, line 22 is in the POD, so the error message is wrong, or the DBI.pm you are executing is not the DBI.pm you think you are executing. I see perl is trying to load C:\Perl\lib\DBI.pm, but I would expect DBI to be located at C:\Perl\site\lib\DBI.pm. Try renaming C:\Perl\lib\DBI.pm, C:\Perl\lib\DBI and C:\Perl\lib\DBD to something else temporarily.
PS - I'm using ActivePerl 5.8.8 (like you), Exporter 5.58 (like you) and the DBI obtained using using ppm (1.50), and I have no problem.
| [reply] [d/l] [select] |