# assuming $sth1 is a previously prepared statement handle my $sth2 = $dbh->prepare( $sth1->{Statement} ); my $ParamValues = $sth1->{ParamValues} || {}; my $ParamTypes = $sth1->{ParamTypes} || {}; $sth2->bind_param($_, $PV->{$_} $PT->{$_}) for keys %{ %$PV, %$PT }; $sth2->execute(); #### # assuming $sth1 is a previously prepared statement handle my $sth2 = $dbh->prepare( $sth1->{Statement} ); my $ParamValues = $sth1->{ParamValues} || {}; my $ParamTypes = $sth1->{ParamTypes} || {}; $sth2->bind_param($_, $ParamValues->{$_} $ParamTypes->{$_}) for keys %{ %$ParamValues, %$ParamTypes }; $sth2->execute(); #### use strict; use Data::Dumper; use DBI; my $h = DBI->connect; my $s = $h->prepare(q/insert into mje values(?)/); $s->bind_param(1, 2); $s->execute; my $ParamValues = $s->{ParamValues} || {}; my $ParamTypes = $s->{ParamTypes} || {}; print Dumper($ParamValues); print Dumper($ParamTypes); my $s2 = $h->prepare(q/insert into mje2 values(?)/); $s2->bind_param($_, $ParamValues->{$_}, $ParamTypes->{$_}) for keys %{ %$ParamValues, %$ParamTypes }; #### $VAR1 = { '1' => 2 }; $VAR1 = { '1' => { 'TYPE' => 4 } }; Can't use string ("1/8") as a HASH ref while "strict refs" in use at /tmp/z.pl line 18.