ablog

不器用で落着きのない技術者のメモ

2012-01-31から1日間の記事一覧

Perl で変数を使ってファイルハンドル名を動的に生成する

こんな感じでできたのでメモ。 ソースコード filehandle.pl #!/usr/bin/env perl use strict; use warnings; my @array = (1,2,3,4,5,6,7,8,9,10); foreach my $item (@array) { no strict "refs"; my $fh = "OUT${item}"; open (${$fh}, ">", "${item}.txt"…

Perl の grep sort map とか

Perlクックブック〈VOLUME1〉作者: トムクリスチャンセン,ネイザントーキントン,Tom Christiansen,Nathan Torkington,Shibuya Perl Mongers,ドキュメントシステム出版社/メーカー: オライリージャパン発売日: 2004/09/01メディア: 単行本購入: 1人 クリック:…

String found where operator expected at ... (Missing operator before ...?)

String found where operator expected at ./status_log_spliter.pl line 109, near "} "$line\n"" (Missing operator before "$line\n"?) ある Perl スクリプトを実行すると、実行はできるけど「String found where operator expected」と怒られるので、 pr…