in reply to adding text from different txt file into hash
#!/usr/bin/perl use strict; use warnings; open(FILE1, '<', 'file1.txt') or die $!; open(FILE2, '<', 'file2.txt') or die $!; open(FILE3, '>', 'file3.txt') or die $!; my %hash; while ( <FILE1> ) { chomp; my $val = <FILE2>; chomp $val; $hash{ $_ } = $val; } print FILE3 "$_ = $hash{ $_ }\n" for keys %hash;
Cheers - L~R
|
|---|