http://qs321.pair.com?node_id=345068


in reply to Re: Ensuring forward compatibility
in thread Ensuring forward compatibility

Please tell a perl novice why this is so.

-Theo-
(so many nodes and so little time ... )

Replies are listed 'Best First'.
Re: Re: Re: Ensuring forward compatibility
by eserte (Deacon) on Apr 14, 2004 at 14:59 UTC
    Apache::Registry automatically puts every script in its own namespace, something like Apache::ROOT$script_name. This is so to avoid name clashes in global variables and subroutines, because every Apache::Registry script is running in the same perl interpreter. Putting a "package main" on top of such a script would make the special namespace void and thus name clashes would be possible.

    As a workaround, one could use "package my_distinct_script_name" instead of "package main".