Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Why was it neccessary to pass a DBI handler by reference?

by derby (Abbot)
on Jan 28, 2004 at 17:13 UTC ( [id://324713]=note: print w/replies, xml ) Need Help??


in reply to Why was it neccessary to pass a DBI handler by reference?

Just changing to \$dbh will not work without other changes. So the big question is are you sure you just changed the new call and the new method (to properly de-reference the reference to $dbh)? Were there possibly any other changes?

-derby

Replies are listed 'Best First'.
Re: Re: Why was it neccessary to pass a DBI handler by reference?
by kudra (Vicar) on Jan 29, 2004 at 14:02 UTC
    I made the following changes:
    • call to $one->new sends \$dbh instead of $dbh.
    • One::new expects \$dbh instead of $dbh, and dereferences it.
    That's it. I didn't expect it to work, and only tried it because the symptom seemed to be that of a variable passed by value, not by reference. The fact that it did work has left me bewildered, and is the reason I started this thread.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://324713]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-19 03:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found