Up Prev Next
From: Java G <guy at vi dot net>
Subject: Re: Passing a $dbh to a subroutine
Date: Sep 18 1997 4:09PM
> Can this be done? Right now in a majority of my applications I
> subs to carry out inserts, updates, selects, etc.. Each one of
> subs opens/keeps its own $dbh that is closed automatically when
> sub exits. In order to avoid the overhead of opening/closing the
> connection and re-specifying the connection params each time, can
> just pass the $dbh to the sub and access it that way?
by default, perl variables are global, do there's no
need to pass anything.