by removing all the $str =~ stuff. There were multiple solutions, but I think the question was really along the lines of why we can't access the matched string easily. That is, whey can't we chain the substitutions? Wouldn't chaining the substutions be nice? Is there a string class that allows this kind of thing? It just seems more perlish to be able to chain the substitutions.$str = "the boy walked the dog"; $str =~ s/walked/fed/; $str =~ s/boy/girl/; $str =~ s/dog/Audrey II/;
--traveler
In reply to Chaining string ops by traveler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |