in reply to Removing all non 8 letter words from the dict/words file

Aren't all the length() based solutions forgetting to chomp()? Isn't Silver Wolf going to end up with seven-letter words that way, or maybe six if it's CRLF?


($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
  • Comment on Re: Removing all none 8 letter words from the dict/words file

Replies are listed 'Best First'.
Re^2: Removing all none 8 letter words from the dict/words file
by xdg (Monsignor) on Apr 09, 2006 at 13:08 UTC

    Good point, but not with the -l switch from the command line:

    $ perl -nle 'print if length == 8 && ! /\A\w{8}\z/' /usr/share/dict/wo +rds 10-point 11-point 12-point 16-point 18-point 20-point 48-point -ability Abu-Bekr acantho- [snip]

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.