aoc2023/day1/day1-1.pl
2023-12-04 20:51:18 +01:00

11 lines
137 B
Perl
Executable File

#!/usr/bin/perl
while(<>) {
chomp;
/^\D*(\d)(?:\D*(\d))?\D*$/ or die "no head";
$sum += "$1" . ($2 || $1);
}
print "$sum\n";