in reply to Re^2: using perl to find words for scrabble
in thread using perl to find words for scrabble
My invocation is perl -e "use Games::Literati qw(wordswithfriends); $Games::Literati::WordFile = qq(/usr/dict/wordswithfriends.dict) ; wordswithfriends()" < t.txt
Looking at your invocation: you're obviously on windows; the -e one-liner on Windows requires double-quotes, not linux single quotes; if I try with linux single quotes, I get nothing. If I convert your oneliner to double-quotes instead of single-quotes, it gives the error:
Hashing words... Cannot open words file "./wordlist" No such file or directory at -e line 1.
For your setup, I believe you should use perl -MGames::Literati=scrabble -e"$Games::Literati::WordFile = 'c:\users\tblaz\documents\html_template_data\dict\enable1.txt'; scrabble()" < t.txt. In your script version, $WordFile should not be a my variable; it's part of the Games::Literati module, so, as the documentation says, "These variables are exportable, so can be fully qualified as %Games::Literati::valid, or if included in the export list when you use the module, you can reference them directly", and then gives a multiline example. In your case you'll either need to use Games::Literati qw(scrabble $WordFile); $WordFile = '...';, or use the variable fully qualified variable name, as in use Games::Literati qw/scrabble/; $Games::Literati::WordFile = '...';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: using perl to find words for scrabble
by Aldebaran (Curate) on Sep 12, 2019 at 02:54 UTC | |
by pryrt (Abbot) on Sep 12, 2019 at 13:07 UTC |