adventofcode/2017/07/1.pl
2017-12-28 12:14:51 -05:00

16 lines
271 B
Perl

use 5.20.0;
use experimental qw/ smartmatch /;
my %prog;
while(<>) {
my( $name, @deps ) =
map { split ', ' } /(\S+).*?-> (.*)/;
$prog{$name} = \@deps;
}
my @all_deps = map { @$_ } values %prog;
say $_
for grep { not $_ ~~ @all_deps } keys %prog;