in reply to Re: Chaining string ops
in thread Chaining string ops
my %subst_for = ( "walked" => "fed", "boy" => "girl", "dog" => "Audrey II" ); $_ = "the boy walked the dog"; my $alt = join '|', map quotemeta, keys %subs; s/($alt)/$subst_for{$1}/g;
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: Chaining string ops
by davido (Cardinal) on Aug 28, 2003 at 18:24 UTC | |
by RMGir (Prior) on Aug 28, 2003 at 19:29 UTC |