[tpm] use from a local directory

Uri Guttman uri at StemSystems.com
Tue Mar 22 11:42:35 PDT 2011


>>>>> "FH" == Fulko Hew <fulko.hew at gmail.com> writes:

  FH> On Tue, Mar 22, 2011 at 2:22 PM, Fulko Hew <fulko.hew at gmail.com> wrote:

  FH>     I don't know if I'm doing this right, or in the best manner...

  FH> And... if I get all this to work...

  FH> Since a file can contain multiple packages, how can the
  FH> import discriminate between constants from one package
  FH> versus the others in the use/require'd file?

that can't be done easily with use. it only calls the import method on
the class it is given. it also loads the file which matches the class
name (with :: converted to /, etc.). why do you have multiple packages
in one file? you could break them up and have a wrapper file use them
with importing the constants and then exporting all of them to the
user. you could have the primary class (same name as the file) import
the constants from the other classes and export them. or even with some
more powerful modules, you could export the constants directly from
their classes.

i just smell a design flaw here rather than a problem that needs to be
solved in this way. you seem to have painted yourself into a corner with
this design.

uri

-- 
Uri Guttman  ------  uri at stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


More information about the toronto-pm mailing list