Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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 line 22. Compilation failed in require at line 15. BEGIN failed--compilation aborted at line 15.

Replies are listed 'Best First'.
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?


    "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 (Archbishop) on Sep 13, 2006 at 12:45 UTC

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


        How did you install Perl? How did you install Which DBD are you using? How did you install that?


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

        What version of Perl (perl -v), DBI (perl -MDBI -le "print DBI->VERSION") and Exporter (perl -MExporter -le "print Exporter->VERSION") are you using?

        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.

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 you are executing is not the you think you are executing. I see perl is trying to load C:\Perl\lib\, but I would expect DBI to be located at C:\Perl\site\lib\ Try renaming C:\Perl\lib\, 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://572725]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2018-05-21 18:00 GMT
Find Nodes?
    Voting Booth?