Perlコーディング初心者質問スレ Part 57at PHP
Perlコーディング初心者質問スレ Part 57 - 暇つぶし2ch147:nobodyさん
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);


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch