Advertisement
Guest User

stripe3 level0

a guest
May 22nd, 2015
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.44 KB | None | 0 0
  1. #!/usr/bin/env perl
  2.  
  3. # Our test cases will always use the same dictionary file (with SHA1
  4. # 6b898d7c48630be05b72b3ae07c5be6617f90d8e). Running `test/harness`
  5. # will automatically download this dictionary for you if you don't
  6. # have it already.
  7.  
  8. my $path = (shift @ARGV) || '/usr/share/dict/words';
  9. open FILE, "<$path";
  10. my %entries = map {chomp; $_ => 1} <FILE>;
  11.  
  12. while (<>) {
  13.     s/([^ \n]+)/(exists $entries{lc $1}) ? $1 : "<$1>"/ge;
  14.     print;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement