From the site "One Minute Perl Book Reviews", which mysteriously vanished at some point since the release of Camel 3:
The Perl Book Litmus Test
Remember, the point of this test is to find bad books and there can only be negative results with this test. A book which passes all the tests put forth here CAN STILL SUCK.
Flip to the index. Look up the following tidbits and answer the questions.
- localtime
Does it state that it returns the number of years since 1900? Does it mention that when used in scalar context it returns a nicely formated date?- srand
Check how it uses srand(). Does it warn you to call it only once in a given program? (If srand is never mentioned, that's okay)- Number of elements in an array
Does it say that an array will return its number of elements in scalar context, or does it use $num = $#array + 1;- flock
Does it discuss and use flock instead of lockfiles? (ie. setting some .lock file instead of using flock().) It's okay if file locking is never discussed at all.- Portable Constants
When performaing flocking, socket operations or sysopens does it define it use the constants defined by Perl, or do they define their own unportable constants? (It's okay if the book never has to use these constants at all)
All very inspiring. Generally good. I suspect it could do with some refinement though.
If all Perl books were like this then the world would be a happier place. Of course, there's still all those existing programs and the people who learn their Perl from them rather than books. Can't win 'em all =)