#!/usr/bin/perl my @l = split /(\n)/, <<ENDE; Guido bla1 ... Mike bla2 ... Klaus bla3 ... ENDE my %h = qw/ Guido Meyer Mike Smith Klaus Rothschild/; for (@l) { s/(\w+)/$h{$1} || $1/e; print } __OUTPUT__ Meyer bla1 ... Smith bla2 ... Rothschild bla3 ...
In reply to Re: exchange words in text
by borisz
in thread exchange words in text
by Murcia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |