Re: use base and @ISA with package re-definition
- From: bigmattstud@xxxxxxxxx
- Date: Mon, 24 Mar 2008 21:46:30 -0700 (PDT)
On Mar 25, 2:57 pm, Uri Guttman <u...@xxxxxxxxxxxxxxx> wrote:
Yes, I'd agree with that. I probably need to include some background,"b" == bigmattstud <bigmatts...@xxxxxxxxx> writes:
you seem to be going about this in a very bizarre and tricky way. it is
much easier to dynamically load modules with different names (maybe
under the same higher level namespace) and use OO polymorphism to call
into them as needed. no muss no fuss!
this is actually a system for handling deployment of code from a
source control system. All code needs to be extracted from source
control (based on tags) and copied to some target directory, but some
file types need to have some sort of 'execution ready' behaviour
performed on them after extraction, eg Java programs need to be
compiled and SQL files need to be executed in a database. Our current
system does this using Ant, by placing a build.xml file in the target
directory. The build.xml file serves two purposes: (a) its presence
indicates that some further action is required and (b) the contents
specify what action(s) to perform. If a build.xml is found in the
target directory Ant gets invoked and the required actions are
performed.
I started to get sick of the limitations of Ant, and since the wrapper
script which was handling this deploy was in Perl I decided to try and
implement a similar concept. Each target directory would contain a
very small Perl class which could extend various base classes to
implement specific deployment behaviours. Since there are many of
these directories, and the classes are not required after that
directory has been processed, I thought it was easier to keep the same
name rather than trying to manage the namespace clashes within the
modules.
As above, the wrapper script moves through the target deploy
what decides which of these modules (or more than one?) to load?
directories and loads the module if it finds one.
b> # Clean out the previous definition of MyMod by deleting the entriesYes, I thought the same, that's why I asked the question. It did seem
b> from the INC hash and the global symbol
b> # table
b> delete $INC{"MyMod.pm"} ;
b> delete $main::{'MyMod::'} ;
b> pop @INC ;
ewww.
to work though.
.
- References:
- use base and @ISA with package re-definition
- From: bigmattstud
- Re: use base and @ISA with package re-definition
- From: Uri Guttman
- use base and @ISA with package re-definition
- Prev by Date: Re: use base and @ISA with package re-definition
- Next by Date: Pattern matching
- Previous by thread: Re: use base and @ISA with package re-definition
- Next by thread: Re: use base and @ISA with package re-definition
- Index(es):
Relevant Pages
|