Created
January 5, 2010 22:58
-
-
Save beppu/269826 to your computer and use it in GitHub Desktop.
If a .psgi file and a .cgi file use the same .pm that happens to have an exit in it, CGI::Compile won't catch the exit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use common::sense; | |
| use Plack::App::CGIBin; | |
| warn "curl http://127.0.0.1:5000/problem.cgi\n"; | |
| # If both the .psgi file and a .cgi file uses | |
| # a module with an exit statement in it, CGI::Compile's fake exit | |
| # doesn't get called. | |
| # | |
| # Comment out the following line to make the problem go away. | |
| use Problem; | |
| my $cgi_bin = Plack::App::CGIBin->new(root => '.')->to_app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use Problem; | |
| use CGI; | |
| my $q = CGI->new; | |
| print $q->header; | |
| Problem::main; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Problem; | |
| sub main { | |
| print "The following exit does not get caught.\n"; | |
| exit; | |
| } | |
| 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment