in reply to That solved it!
in thread Apache::Registry losing subs created via globs.
Your 'INIT' in the module would be a valid label if it ended in a ':', or it would be a valid BEGIN block if it said "BEGIN". I'm not sure what it gets parsed as here or why it works in one situation but not the other.my $code = <<EOT; sub abc::def { use Dmitri::Test; print <<HTML; Content-type: text/plain HTML use strict; use warnings; Dmitri::Test::say_hi; } EOT eval $code; abc::def();
Update: from perlsyn:
The LABEL is optional, and if present, consists of an identifier followed by a colon.
Update: I now see that INIT is a valid block and is in perlcompile and perlmod, though I still wouldn't know for sure why it behaves the way it does in the above situation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
I think I figured it out. [was: Re: Re: That solved it!]
by dmitri (Priest) on Nov 07, 2002 at 15:28 UTC | |
|
And still.. [was: Re: Re: That solved it!]
by dmitri (Priest) on Nov 06, 2002 at 22:51 UTC |