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: Mike Matthews <michael dot matthews at chron dot com>
Subject: Re: Passing a $dbh to a subroutine
Date: Sep 18 1997 6:12PM

Java G wrote:
> 
> salvatore.sferrazza@ny.ubs.com wrote:
> 
> >      Can this be done?  Right now in a majority of my applications I
> > write
> >      subs to carry out inserts, updates, selects, etc..  Each one of
> > these
> >      subs opens/keeps its own $dbh that is closed automatically when
> > the
> >      sub exits.  In order to avoid the overhead of opening/closing the
> >
> >      connection and re-specifying the connection params each time, can
> > I
> >      just pass the $dbh to the sub and access it that way?
> >
> >      TIA,
> >
> >      Sal
> 
>    by default, perl variables are global, do there's no
> need to pass anything.
> 
> G
Unless of course you use strict, which you should.
--
Mike Matthews                        michael.matthews@chron.com
Houston Chronicle Interactive   http://www.houstonchronicle.com