Short, ugly version below. Responsible error checking and file handling are left to the student.
#!/usr/bin/env perl use Modern::Perl; my @old = `cat old.txt`; chomp @old; my @new = `cat new.txt`; chomp @new; my %h; @h{@old} = @new; my $text = `cat log.txt`; $text =~ s/$_/$h{$_}/g for @old; print $text;
Aaron B.
Available for small or large Perl jobs; see my home node.
In reply to Re: Array Element Substitution
by aaron_baugher
in thread Array Element Substitution
by Mac1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |