my %replace = ('111'=>bar, '222'=>world, '333'=>perl); my $find = join "|", sort keys %replace; my $str = "f111,f222,f333"; $str =~ s/f(0-9)/$replace{$1}/g;
I am expecting the output as "bar, world, perl". but instead the output is "11,22,33". neone suggest me whts wrong pls?In reply to problem with substitute in regexp by upaksh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |