while (<F1>) { /(\w*) (\d*)/ ; $hash1{$1} = $2 ; }
This won't solve your problem, but it's worth pointing out that you should never use $1, $2, etc without checking that the match succeeded. If the match failed then you'll get the values from the previous successful match.
while (<F1>) { if (/(\w*) (\d*)/) { $hash1{$1} = $2; } else { warn "Invalid input line $.: $_\n"; } }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: file merge problem
by davorg
in thread file merge problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |