in reply to Re^2: $dbh could not be passed to function unless another variable is also passed
in thread $dbh could not be passed to function unless another variable is also passed
That also works fine. SSCCE:
$ cat close.pl #!/usr/bin/env perl use strict; use warnings; use DBI; my $dbh = DBI->connect ('dbi:SQLite:dbname=foo', '', ''); close_db ($dbh); sub close_db { my $dbh = $_[0]; $dbh->disconnect or die "Could not disconnect: $DBI::errstr\n"; } $ perl close.pl $
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: $dbh could not be passed to function unless another variable is also passed
by tukusejssirs (Beadle) on Aug 08, 2019 at 14:01 UTC | |
by Corion (Patriarch) on Aug 08, 2019 at 14:09 UTC | |
by tukusejssirs (Beadle) on Aug 08, 2019 at 14:53 UTC | |
by hippo (Archbishop) on Aug 08, 2019 at 14:58 UTC | |
by dsheroh (Monsignor) on Aug 09, 2019 at 07:24 UTC | |
by Fletch (Bishop) on Aug 08, 2019 at 14:11 UTC |