aboutsummaryrefslogtreecommitdiffstats
path: root/incdec.pm
diff options
context:
space:
mode:
Diffstat (limited to 'incdec.pm')
-rw-r--r--incdec.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/incdec.pm b/incdec.pm
index f13209b..b810bf4 100644
--- a/incdec.pm
+++ b/incdec.pm
@@ -4,7 +4,7 @@ use warnings;
package incdec;
sub incdec {
- my ($line, $point_position, $is_backward) = @_;
+ my ($line, $increment_by, $point_position, $is_backward) = @_;
$point_position ||= 0;
$is_backward ||= 0;
@@ -38,7 +38,7 @@ sub incdec {
}
pos($line) = $start_position;
- $line =~ s/\G([^\d]*)(\d+)/$1 . ($2 + 1)/e;
+ $line =~ s/\G([^\d]*)(\d+)/$1 . ($2 + $increment_by)/e;
return $line;
}