How about
use strict; use warnings; my $str = '4512872356698'; my $len = length $str; substr($str, 6, $len - 10) = 'X' x ($len - 10); print "$str\n";
Using lvalue substr for good effect.
In reply to Re: regular expression
by moritz
in thread regular expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |