Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created March 2, 2019 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDaniel/2d5a6107d2f8bc950bd7b8c00d9240d7 to your computer and use it in GitHub Desktop.
Save AlexDaniel/2d5a6107d2f8bc950bd7b8c00d9240d7 to your computer and use it in GitHub Desktop.
for $log.IO.lines {
if /^‘start = ’$<s>=[<[0..9]>+]‘ ; end = ’$<e>=[<[0..9]>+]‘ ; sum = ’$<sum>=[‘-’?<[0..9]>+]$/ {
#my $s = $0;
#my $e = $1;
#my $sum = $2;
say "$<s> $<e> $<sum>";
%starts{$<s>}{$<e>}{$<sum>} = True;
#if +%starts{$s} >1 or +%starts{$s}{$e} > 1 {
# die %starts{$s};
#}
%ends{$<e>}{$<s>}{$<sum>} = True;
#if +%ends{$e} >1 or +%ends{$e}{$s} > 1 {
# die %ends{$e};
#}
} else {
die "not match $_";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment