On Thu, 14 Dec 2000, Tom Brown wrote:
> On Thu, 14 Dec 2000, Ajit Deshpande wrote:
> > > 2. The POD for Apache::Registry says that it doesn't like __END__ and
> > > __DATA__ tokens. So what affect do these actually have if left in? Does
>
> In scripts? it's a syntax error, but that's a completely separate issue
> from modules which get used "as is" ...
>
> scripts get wrapped inside braces (and probably an eval) and obviously if
> you cut off the closing braces with an __END__ you're going to be in
> trouble...
>
> Apache::Registry isn't that big or complex ... have a look at it...
sorry, I realized I over simplified my answer and there are good
conclusions to be had from a better one... so my apologies for following
up on my own post...
here's the immediately relevent code from Apache::Registry.pm
my $eval = join(
'',
'package ',
$package,
';use Apache qw(exit);',
'sub handler {',
$line,
$sub,
"\n}", # last line comment without newline?
);
compile($eval);
... what you think of as your script is $sub in this join()... $package is
the Registry assigned package name, $line is a hint to the perl compiler
to try to get line numbers fixed...