# Get a comma separated list of the field names .. my $fields = join(',', keys %$args); # Get the values into an array .. my @values = values %$args; # Get a comma separated list of '?', one for each value # .. my $placeholderList = join(',',('?') x @values);