use strict; use warnings; for (qw(5234 523 52)) { print append($_ , '_'), "\n"; } sub append { my $val2 = shift; my $character = shift; if ($val2 =~ /(\d{2,3})/) { my $in = $1; my $num = join $character, split //, $in; $val2 =~ s/$in/$num/; } else { return; } return $val2; } __END__ 5_2_34 5_2_3 5_2
In reply to Re: Check substitute digit
by toolic
in thread Check substitute digit
by tart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |