|
|
|
Perl version
I should mention that this works for 10.4. I haven't upgraded yet, just about backed up and ready to go. So the 10.5 dictionary may be in a different place and may be a different format.
The command switches are documented in "man perlrun". -n makes perl read the input file in a while loop until the file is read completely. -e indicates the next argument is a script. The regex looks for a pattern like which indicates an entry in the dictionary. The actual entry word is between the last 2 double quotes which is caught by the brackets and referenced by the $1 in the while loop. The /g modifier at the end of the regex allows the while loop to loop through the file. The $a is needed to retain the "word" through another regex. The backslash-b's makes the regex the equivalent of -w. Is that clear? Perl is a strange language.
Perl version
The dictionary indeed has a slightly different name in 10.5 but I corrected that already.
I had checked 'man perl' not 'man perlrun', thanks for pointing me to that. Perl is still ok, regular expressions are what often throws me off. |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,520 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.04 seconds |
|