sub putData { my $self = shift; my $sql = shift; my %param = @_; # get the statement handle my $sth = $self->dbh()->prepare($sql); # do the param binding for my $name (keys %param) { $sth->bind_param(":$name", $param{$name}); } # execute $sth->execute(); } #### $mydb->putData( # the SQL 'BEGIN myApp.myProc(:foo, :bar, :baz); END;', # the named params foo => "whatever", bar => $data, baz => $obj->method('arg'), );