Re: contention for require()'d code library

[prev] [thread] [next] [Date index for 2005/02/08]

From: Joe Schaefer
Subject: Re: contention for require()'d code library
Date: 16:52 on 08 Feb 2005
Matthew Berk <matthew@xxxxxxx.xxx> writes:

> Apologies in advance for the conceptual nature of this inquiry.
>
> I have two chunks of code that are being run as separate scripts under
> Registry. Both are using require() (I know, I know) to pull in a
> library of subroutines. 

If you're abusing require() as a means of adding external
subroutines directly into your script, then that's not 
going to work with Registry.  One thing that works, I think,
would be to use a package declaration at the start of the library, 
and change the script to call those subroutines by their 
package-qualified names:

                old lib: sub foo {} ...
                new lib: package Foo; sub foo{} ...
             old script: require $mylib; foo(4); ...
             new script: require $mylib; Foo::foo(4); ...

This may not be the best solution, but I'm sure this issue is well 
documented somewhere on the perl.apache.org site.

        -- 
        Joe Schaefer

(message missing)

contention for require()'d code library
Matthew Berk 16:28 on 08 Feb 2005

Re: contention for require()'d code library
Perrin Harkins 16:34 on 08 Feb 2005

Re: contention for require()'d code library
Joe Schaefer 16:52 on 08 Feb 2005

Re: contention for require()'d code library
Matthew Berk 17:01 on 10 Feb 2005

Re: contention for require()'d code library
Perrin Harkins 17:09 on 10 Feb 2005

Generated at 11:21 on 20 Feb 2005 by mariachi v0.52