Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: prepare insert statement outside while loop for speed

by McDarren (Abbot)
on Dec 02, 2010 at 05:19 UTC ( #874824=note: print w/replies, xml ) Need Help??


in reply to prepare insert statement outside while loop for speed

$sth->execute($data[0],$data[1],$data[2], $data[3], $data[4],$data[5])
The above could be written a bit more succinctly as:
$sth->execute(@data[0 .. 5])
See Slices

Or, if you know that @data will always contain just six elements, then just simply:

$sth->execute(@data)
Hope this helps,
Darren

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2016-10-01 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (574 votes). Check out past polls.