An Apache::Registry script cannot contain __END__ or _ _DATA_ _ tokens, because Apache::Registry wraps the original script's code into a subroutine called handler( ), which is then called. Consider the following script, accessed as /perl/test.pl:
print "Content-type: text/plain\n\n"; print "Hi";
When this script is executed under Apache::Registry, it becomes wrapped in a handler( )subroutine, like this:
package Apache::ROOT::perl::test_2epl;
use Apache qw(exit);
sub handler {
print "Content-type: text/plain\n\n";
print "Hi";
}
If we happen to put an __END__ tag in the code, like this:
print "Content-type: text/plain\n\n"; print "Hi"; __END__ Some text that wouldn't be normally executed
it will be turned into:
package Apache::ROOT::perl::test_2epl;
use Apache qw(exit);
sub handler {
print "Content-type: text/plain\n\n";
print "Hi";
__END__
Some text that wouldn't be normally executed
}
When issuing a request to /perl/test.pl, the following error will then be reported:
Missing right bracket at .... line 4, at end of line
Perl cuts everything after the __END__ tag. Therefore, the subroutine handler( )'s closing curly bracket is not seen by Perl. The same applies to the __DATA__ tag.
 
Continue to: