Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

(dkubb) Re: (1) A more elegant solution?

by dkubb (Deacon)
on Jun 05, 2001 at 10:00 UTC ( #85709=note: print w/replies, xml ) Need Help??


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), ); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://85709]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-11-26 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?