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

  • Home
  • SEARCH
  • 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 should'nt be that difficult but for some reason i'm having trouble with this.
I'm having some troubles with updating linq to sql entities. For some reason, I
for some reason i can not understand im having troubles with mysql_num_rows. Heres the
I'm attempting to implement the latest Facebook Connect SDK and I'm having some troubles.
For some reason I'm having trouble accessing the fopen() function from inside a class
Hi I am having trouble with this function. For some reason weird values are
I'm having some troubles with ending a group of dynamically created threads. The reason
For some reason I am having trouble getting my head around __init__ and __new__
My Javascript is quite basic, but for some reason I am having trouble. I
I'm new to linq and having trouble writing two simple queries. For some reason,

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.