Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

injunjoel's scratchpad

by injunjoel (Priest)
on Jun 01, 2004 at 16:28 UTC ( #358188=scratchpad: print w/ replies, xml ) Need Help??

A possible new idiom for deleting array elements?
my @arr = 1 .. 20; my @excludes = (1,3,5,7,9,11,13,15,17,19); @arr[@excludes] = (); @arr = grep $_, @arr; print join(" : ", @arr)."\n";
"Python is like Perl's tightly-wound, responsible, predictable cousin from out of town who has a funny foreign accent. ;)" -rudder
use DBI; #connect and stuff. create the DB handle my %hash = ( 'col1'=>$somevalue, 'col2'=>$someothervalue, 'col3'=>$yav); my $sql = qq~INSERT INTO table1(~ . join(',', sort keys %hash). qq~) VALUES(~. join(',',('?' x scalar( keys %hash))). qq~)~; my $sth = $dbh->prepare($sql); $sth->execute(@hash{(sort keys %hash)});
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2014-12-26 14:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls