08/03/18 21:49:40
>>138
#!/usr/bin/perl -w
use strict;
use Scalar::Util qw(looks_like_number);
test(@ARGV);
test(map looks_like_number($_) ? $_ : 0, @ARGV);
sub test {
my($hoge, $fuga) = @_;
print "hoge:[$hoge] fuga:[$fuga] ";
$hoge += $fuga;
print "result:[$hoge]\n";
}
>>144
my $col = join ',', my @col = keys %hash;
my $phs = join ',', ('?') x @col;
my $sth = $dbh->prepare("INSERT INTO test($col) VALUES($phs)");
$sth->execute(values %hash);