my $text = << 'end_of_test'; Your child <child> is invited to come to our school. Your child's teacher will be <teacher>, and the class is held in <room>."; end_of_test my %hash = ('child' => 'mary', 'teacher' => 'mrs b', 'room' => '123'); print "Raw: $test\n"; $test =~ s[<(\w+)>] [defined($hash{$1}) ? $hash{$1} : warn]ieg; print "Processed: $test\n";
In reply to Re: regex substitution
by tomazos
in thread regex substitution
by michellem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |