Hi,

I have script:

use strict;
use warnings;
use lib '/data/home/2ge/perl/modules';
use Foo::Bar;

my $dbh = DBI->connect("DBI:mysql:database=foo;host=localhost;port=3306", "", 
"")
        or die "Can't connect: ", $DBI::errstr;
...

now I want to share this $dbh connection to Bar.pm, so I should use there:
sub db_get {
    my ($a) = $dbh->selectrow_array("SELECT foo FROM bar WHERE foo =
    ?", {}, shift );
}

--

 --. ,--  ,-     ICQ: 7552083      \|||/    `//EB: www.2ge.us
,--' |  - |--    IRC: [2ge]        (. .)    ,\\SN: 2ge!2ge_us
`====+==+=+===~  ~=============-o00-(_)-00o-================~
Marriage is an attempt to change a night owl into a homing pigeon.
 




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to