Skip to content

Instantly share code, notes, and snippets.

@bradclawsie
Created December 24, 2011 08:15
Show Gist options
  • Save bradclawsie/1516777 to your computer and use it in GitHub Desktop.
Save bradclawsie/1516777 to your computer and use it in GitHub Desktop.
loaddictionary.pl
#!/usr/bin/env perl
use v5.12;
use warnings;
use strict;
use Cache::Memcached;
my $memd = Cache::Memcached->new();
$memd->set_servers(["localhost:11212"]);
open(my $fh,"<","/usr/share/dict/words") || die "open $!";
my $line = <$fh>; # get rid of first empty line
while ($line = <$fh>) {
chomp $line;
$memd->set($line,"1");
}
close($fh);
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment