diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-06-30 17:57:46 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-06-30 17:57:46 +0100 |
| commit | b7e9215fa96225b8ac5d90b79c0bfb01bbe56bf9 (patch) | |
| tree | 474dc27b68285c892242001946b37cccc604194e /challenge-014 | |
| parent | 167bffb88aacd78e446d7803a9855fda47a95c23 (diff) | |
| download | perlweeklychallenge-club-b7e9215fa96225b8ac5d90b79c0bfb01bbe56bf9.tar.gz perlweeklychallenge-club-b7e9215fa96225b8ac5d90b79c0bfb01bbe56bf9.tar.bz2 perlweeklychallenge-club-b7e9215fa96225b8ac5d90b79c0bfb01bbe56bf9.zip | |
- Added solution by Neil Bowers.
Diffstat (limited to 'challenge-014')
| -rw-r--r-- | challenge-014/neil-bowers/perl5/ch-2.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-014/neil-bowers/perl5/ch-2.pl b/challenge-014/neil-bowers/perl5/ch-2.pl new file mode 100644 index 0000000000..216e7887c9 --- /dev/null +++ b/challenge-014/neil-bowers/perl5/ch-2.pl @@ -0,0 +1,11 @@ +#!/usr/bin/perl + +use File::Slurper qw/ read_lines /; + +my @states = read_lines('state-codes.txt'); +my $re = join('|', @states); +my @words = grep { /^($re)+$/ } + sort { length($b) <=> length($a) } + read_lines('word-list.txt'); + +print $words[0], "\n"; |
