aboutsummaryrefslogtreecommitdiffstats
path: root/pos.pl
diff options
context:
space:
mode:
Diffstat (limited to 'pos.pl')
-rw-r--r--pos.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/pos.pl b/pos.pl
new file mode 100644
index 0000000..f9c365f
--- /dev/null
+++ b/pos.pl
@@ -0,0 +1,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";