Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 68145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:22:14+00:00 2026-05-10T19:22:14+00:00

For some reason I am having troubles with a DBI handle. Basically what happened

  • 0

For some reason I am having troubles with a DBI handle. Basically what happened was that I made a special connect function in a perl module and switched from doing:

do 'foo.pl' 

to

use Foo; 

and then I do

$dbh = Foo->connect; 

And now for some reason I keep getting the error:

Can’t locate object method ‘rollback’ via package ‘Foo’ at ../Foo.pm line 171.

So the weird thing is that $dbh is definitely not a Foo, it’s just defined in foo. Anyway, I haven’t had any troubles with it up until now. Any ideas what’s up?

Edit: @Axeman: connect did not exist in the original. Before we just had a string that we used like this:

do 'foo.pl'; $dbh = DBI->connect($DBConnectString); 

and so connect is something like this

sub connect {     my $dbh = DBI->connect('blah');     return $dbh; } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:22:15+00:00Added an answer on May 10, 2026 at 7:22 pm

    From perlfunc:

             do 'stat.pl';      is just like          eval `cat stat.pl`; 

    So when you do 'foo.pl', you execute the code in the current context. Because I don’t know what goes on in foo.pl or Foo.pm, I can’t tell you what’s changed. But, I can tell you that it’s always executed in the current context, and now in executes in Foo:: namespace.

    The way you’re calling this, you are passing 'Foo' as the first parameter to Foo::connect or the returned sub from Foo->can('connect'). It seems that somehow that’s being passed to some code that thinks it’s a database handle, and that’s telling that object to rollback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably stupid simple, but for some reason I'm having trouble getting it
Ok so basically I have this text file with numbers and letters that's supposed
I'm having trouble using Simple Xml Serializer to build a Message from a complex
I'm having trouble reading in XML data from an XML resource located in /res/xml/testxml.xml.
I'm having trouble using Zend HTTP on a URL: $client = new Zend_Http_Client('http://xxfire_killumiex.api.channel.livestream.com/2.0/info.json'); $feed
I am having trouble with my main menu in Joomla. I have the installation
I'm having trouble with file scans and are these 2 expressions equivalent to each
I am running an AdWords campaign and I am having trouble with the conversion
I'm trying to use Flurry Analytics for my program on Android and I'm having
I have recently started learning java as my first ever step into object oriented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.