Conrad, Bill (ThomasTech) <> wrote: > Hi Brian > > Right now I am just experiment with Perl and the eval() statement to > see what happens internally. Several years ago (Before XMLSpy, > Oxygen, Stylus Studio, etc.) I wrote an XML Editor using Perl Tk, > Tk::Text::SuperText, Perl Parser's, etc. I supported various plug ins > based on the DTD or Schema and the editing requirements via Perl > Scripts which I executed from the editor via an eval() statement. The > code within the eval accessed packages and functions within the > editor but did not modify any variable within the editor. The editor > performed the request functions and returned values to the code > within the eval but did not modify any variables within the eval > directly. When the eval code terminated I wanted to return the editor > to the state it was in before the eval. One of the problems I had was > Sub routines within the eval remained in the symbol table when the > eval ended which could potentially produce incorrect processing of a > second execution of an eval that contained different code. I think I > did get around the problem by placing the code in a block but I was > just wondering what else I could have done and what the potential > problems are, kind of just playing with Perl's internals and dumping > the results.
That sort of rings a bell, or perhaps it is déjà vu? I'm not entirely sure I understand what you are trying to do. I think appropriate use of namespaces (i.e. packages) should allow you to avoid sub name conflicts, and autoload can help with the dynamically generating subs. I think using plugin objects will allow you to do much of what you want to do, short of actually "return the editor to the state it was in before the eval", which I suspect is impossible except in a very restricted sense. HTH -- Brian Raven ================================= Atos Euronext Market Solutions Disclaimer ================================= The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions. L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions. _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
