summaryrefslogtreecommitdiff
path: root/014/ch2.pl
diff options
context:
space:
mode:
authorGuillermo Ramos2019-07-05 23:43:12 +0200
committerGuillermo Ramos2019-07-05 23:43:12 +0200
commit20182e2e72d7bc6956faf6acc5e8d52eff64b3a9 (patch)
treefa451ff93d348e815f6502040b24dde16a66cc5b /014/ch2.pl
parentd916ca90c354b29cc1b0953508e9601576a4fd1e (diff)
downloadperlweekly-20182e2e72d7bc6956faf6acc5e8d52eff64b3a9.tar.gz
for -> foreach, fix die interpolation msg
Diffstat (limited to '014/ch2.pl')
-rwxr-xr-x014/ch2.pl4
1 files changed, 2 insertions, 2 deletions
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)