As far as I can tell, your analysis is correct.
Did I find a "mistake" in the wonderful Perl Testing book?
I unfortunately don't have the book so I can't check the exact wording, but you did write the following, to which I added some emphasis:
the book says it's necessary to have the script being tested (a cgi script, in my example) end with the statement "1;" so that the require_ok() in the testing script will always work
That sounds to me like maybe what the book means is "to play it safe, always end the script with 1;, in case someone tries to get clever and writes if !caller instead of unless caller" :-)
In reply to Re: Testing legacy CGI scripts using the "main() unless caller()" technique
by haukex
in thread Testing legacy CGI scripts using the "main() unless caller()" technique
by davebaker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |