in reply to storing database handle object in a variable
You can find proper snippets in man DBI.#create database handle: my $dbh = DBI->connect(...) or die "..."; #use the handle directly: $dbh->do("delete from mytable;"); #or prepare query: my $sth = $dbh->prepare("select 1 from dummy;");
Definitely, use strict; use warnings, specially if you are not secure about the code - my opinion.
|
|---|