aboutsummaryrefslogtreecommitdiffstats
path: root/pos.pl
blob: f9c365f164a3408c1216b3176236fe2c859c730e (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env perl -w

use strict;

my $test = 'test 12 0 45';

$test =~ /(\d+)/g;
pos($test) = 7;
$test =~ s/\G([^\d]*)(\d+)/$1 . ($2 + 1)/e;

print "$test\n";