From 20182e2e72d7bc6956faf6acc5e8d52eff64b3a9 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Fri, 5 Jul 2019 23:43:12 +0200 Subject: for -> foreach, fix die interpolation msg --- 014/ch2.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '014/ch2.pl') diff --git a/014/ch2.pl b/014/ch2.pl index 33e3092..628ddf4 100755 --- a/014/ch2.pl +++ b/014/ch2.pl @@ -51,12 +51,12 @@ sub suitable { } # Read words from $DICTPATH and store suitable ones in @suitable_words -open(my $dictd, '<', $DICTPATH) or die 'Unable to open dictionary: $!'; +open(my $dictd, '<', $DICTPATH) or die "Unable to open dictionary: $!"; my @suitable_words = grep suitable, <$dictd>; close($dictd); # Find the longest word(s)... -for my $word (@suitable_words) { +foreach my $word (@suitable_words) { my $len = length $word; if ($len == $max_len) { # ... and print their composition (states) -- cgit v1.2.3