in reply to A more elegant solution?
Here's my attempt at a more elegant way of generating an SQL INSERT statement:
sub insert_into { my $table = shift; my $row = shift; return sprintf( 'INSERT INTO %s (%s) VALUES (%s)', $table, join(', ', keys %$row), join(', ', ('?') x keys %$row), ); }
In Section
Seekers of Perl Wisdom