in reply to Smart Search and Replacement with RegEx
sub translate { my $str = shift; my @chunks = split /<(\d+)>/ => $str; my @results; while (@chunks) { my ($number, $string) = splice @chunks => 0, 2; if ($number == 30) { ... } else { push @results => '@(' . $hash {$number} . ')', qq {"$string"}; } } join ";" => @results; }
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Smart Search and Replacement with RegEx
by shelob101 (Sexton) on May 31, 2002 at 02:32 UTC |