#!"C:\perl\bin\perl.exe" -w use strict; use DBI(); use Data::Dumper; my $database = "****"; my $hostname = "****"; my $port = "3306"; my $user = "****"; my $password = "****"; my $table = "****"; # connect my $dbh = DBI->connect("DBI:mysql:database=$database;host=$hostname", "$user", "$password", {'RaiseError' => 1}); my $scalar = ''; open( my $fh, "+>:scalar", \$scalar ); $dbh->trace( 1, $fh ); $dbh->do("INSERT INTO $table(version,filename,release_notes,rec_level,os_type) VALUES(1, 2, 3, 4, 5)"); # retrieve my $sth = $dbh->prepare("SELECT * FROM $table"); $sth->execute(); while (my $ref = $sth->fetchrow_hashref()) { print Dumper $ref; # output OK => gives a hash of one existing line } $sth->finish(); $dbh->disconnect(); print Dumper $scalar;