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: Re: passing $dbh around
Date: Jun 10 1999 10:36PM

David Hajoglou writes:
 > >  > 
 > >  > script
 > >  > ...
 > >  > $var = &itel::itel_lib::somefunc($dbh);
 > >  > ...
 > >  > 
 > > 
 > > 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.
 > > 
 > Does this copy the handle when I pass it into the module?
 > 
 > sub somefunc {
 > 	my $newdbh = @_;
 > ...
 > }
 > 

my ($newdbh) = @_;

or

my $newdbh = shift;

should work fine.

 > The reason I am asking is that we are connecting to an MSSQL database that
 > has a user limmit.  As a result we are finding out selves running out of
 > logins.  We are doing everything to keep the number of handles down.
 > Idealy, persistant handles would be the way to go.

Yeah...

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