Last active
August 29, 2015 14:10
-
-
Save qlkzy/a23157e73379814a4d8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Getopt::Long; | |
| local $\ = "\n"; | |
| my %target; | |
| GetOptions('l|letters=s' => sub { | |
| local $_ = lc $_[1]; | |
| y/a-z//dc; | |
| $target{$_}++ for split //; | |
| }); | |
| LINE: while (<>) { | |
| chomp; | |
| $_ = lc $_; | |
| y/a-z//dc; | |
| my %t = %target; | |
| $t{$_}-- for split //; | |
| for (values %t) { | |
| next LINE if $_ < 0; | |
| } | |
| print; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./countdown.pl -l "$1" /usr/share/dict/british-english-insane | awk '{print length, $0}' | sort | cut -d' ' -f2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment