adventofcode/2017/07/1.pl

16 lines
271 B
Perl
Raw Normal View History

2017-12-07 17:29:08 +00:00
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;