Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Testing legacy CGI scripts using the "main() unless caller()" technique

by haukex (Archbishop)
on Jul 20, 2022 at 20:53 UTC ( [id://11145610]=note: print w/replies, xml ) Need Help??


in reply to Testing legacy CGI scripts using the "main() unless caller()" technique

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" :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-20 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found