Re: use base and @ISA with package re-definition



On Mar 25, 2:57 pm, Uri Guttman <u...@xxxxxxxxxxxxxxx> wrote:
"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!

Yes, I'd agree with that. I probably need to include some background,
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.

what decides which of these modules (or more than one?) to load?

As above, the wrapper script moves through the target deploy
directories and loads the module if it finds one.

b> # Clean out the previous definition of MyMod by deleting the entries
b> from the INC hash and the global symbol
b> # table
b> delete $INC{"MyMod.pm"} ;
b> delete $main::{'MyMod::'} ;
b> pop @INC ;

ewww.

Yes, I thought the same, that's why I asked the question. It did seem
to work though.
.



Relevant Pages

  • Re: Loading secondary form
    ... I was just after the ability to load a form in C# which is what your ... Regards ... Ant ... "Tim Wilson" wrote: ...
    (microsoft.public.dotnet.languages.csharp)
  • Ant complaint
    ... It appears that Ant as it is delivered comes with a bunch of optional ... tasks that it knows about inherently, such as the Scp task. ... When such tasks fail to load the first ... I need to check the jsch jar into my project along with the ...
    (comp.lang.java.softwaretools)
  • Eclipse and ant. I need more flexibility.
    ... I am using eclipse 3.0.1 with ant under RedHat linux. ... When I load an existing project that I have been developing with ant, ...
    (comp.lang.java.softwaretools)
  • Re: slow access
    ... page to download. ... is there ant way ... Do they load equally slowly? ... Please Reply to the Newsgroup ...
    (microsoft.public.windowsxp.general)