]> www.fi.muni.cz Git - aoc.git/blob - 2017/18.pl
Day 25: examining the input
[aoc.git] / 2017 / 18.pl
1 #!/usr/bin/perl
2
3 use v5.30;
4 use strict;
5
6 chomp (my $stream = <>);
7
8 my $glen;
9 1 while $stream =~ s/<([^!>]*)!./<$1/;
10 1 while $stream =~ s/<([^>]*?)>/$glen += length $1/e;
11 say $glen;
12