PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: passing $dbh around
Date: Jun 10 1999 9:22PM

David Hajoglou writes:
 > To all knowing list,
 > 
 > We have decided against persistant database handles (after all of my toil
 > with them).  So, I have a question:
 > 
 > What is the best way to pass a database handle around to different
 > modules?  Or reference the same one across functions?  i.e.
 > 
 > script
 > ...
 > $var = &itel::itel_lib::somefunc($dbh);
 > ...
 > 
 > is there a way to make a pointer to the original handle?  If this is
 > documented somewhere then just point me there.

The way you're doing it in the snippet above is just fine. A database
handle is just a normal scalar, so you can pass it around as much as
you like.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com