Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Can't locate object method "require_version"

by Win (Novice)
on Sep 13, 2006 at 12:33 UTC ( #572725=perlquestion: print w/ replies, xml ) Need Help??
Win has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I set up Perl on a Win XP box a couple of months ago. I have just started to try and use it and I've got the following error message. Can anyone please explain the message.
Can't locate object method "require_version" via package "DBI" at C:/P +erl/lib/DB I.pm line 22. Compilation failed in require at XXX.pl line 15. BEGIN failed--compilation aborted at XXX.pl line 15.

Comment on Can't locate object method "require_version"
Download Code
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

      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.
Re: Can't locate object method "require_version"
by marto (Chancellor) on Sep 13, 2006 at 12:45 UTC
      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;

        How did you install Perl? How did you install DBI.pm? Which DBD are you using? How did you install that?

        --
        <http://dave.org.uk>

        "The first rule of Perl club is you do not talk about Perl club."
        -- Chip Salzenberg

        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
        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
        What version of Perl (perl -v), DBI (perl -MDBI -le "print DBI->VERSION") and Exporter (perl -MExporter -le "print Exporter->VERSION") are you using?
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;
      Please elaborate.

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://572725]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-08-01 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls