Perlについての質問箱 30箱目at TECHPerlについての質問箱 30箱目
- 暇つぶし2ch413:デフォルトの名無しさん 07/05/03 07:47:00 #!/usr/bin/perl use strict; use warnings; open my $a, '<', 'a.txt' or die; open my $b, '<', 'b.txt' or die; my %ids = map { $_ => 1 } map { (split /,/)[0] } <$b>; while (<$a>) { my $id = (split /,/)[0]; print if $ids{$id}; }