Skip to content

Commit 54bede2

Browse files
author
Gabriel Corona
committed
Recursive call filter: allow floating point values and better regex handling
1 parent 044f09b commit 54bede2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stackcollapse-recursive.pl

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737

3838
while(<>) {
3939
chomp;
40-
if(/^(.*)\s([0-9]*)/) {
41-
my @stack = split(/;/, $1);
42-
my $value = $2;
40+
my ($stack_, $value) = (/^(.*)\s+?(\d+(?:\.\d*)?)$/);
41+
if ($stack_) {
42+
my @stack = split(/;/, $stack_);
4343

4444
my @result = ();
4545
my $i;

0 commit comments

Comments
 (0)