(I get ~6000 iterations/sec this way vs. ~3000 your way).my $string = 'eichenbaumschule'; my @query = qw(baum ums eic chu le); @query = map { qr/($_)/i } @query; $string =~ s/$_/\U$1/g for @query;
Update: Just realized, this is only a factor if you do the same substitutions multiple times in the same program...if you're only doing this once per run, then you may as well do it delirium's way :-)
In reply to Re^2: Regexp string concat
by runrig
in thread Regexp string concat
by Murcia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |