# Instantiate a handle to the database. use DBI; my $dbh = DBI->connect("dbi:ODBC:$opt_hash{dsn}", $opt_hash{user}, $opt_hash{pass}, {LongTruncOk => 1}) or die "Couldn't open database : '$DBI::errstr'; stopped"; # Instantiate the generator. use XML::Generator::DBI; my $generator = XML::Generator::DBI->new(RowElement => "Message", Handler => $builder, dbh => $dbh); # Obtain a reference to the DOM. my $dom = $generator->execute("exec $opt_hash{sp} \'$opt_dates{start}\', \'$opt_dates{end}\'"); # Print the result print $dom->toString;