Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Array Element Substitution

by aaron_baugher (Curate)
on Aug 23, 2012 at 20:00 UTC ( #989375=note: print w/ replies, xml ) Need Help??

in reply to Array Element Substitution

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.

Comment on Re: Array Element Substitution
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989375]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-11-28 16:47 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls