local *FILE2; open(FILE2, '<', 'file2') or die(...); my %file2 = map { /^(\S+)/; ($1 => $_) } <FILE2>; close(FILE2); local *FILE1; open(FILE1, '<', 'file1') or die(...); while (<FILE1>) { chomp; print($file2{$_}) if (exists($file2{$_})); } close(FILE1);
In reply to Re: comparing arrays
by ikegami
in thread comparing arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |