http://qs321.pair.com?node_id=324558


in reply to Re: Re: Re: detecting $& usage
in thread detecting $& usage

Thanks to everyone for all the help. This is a great site! Yes, the engineers are smart and numerous. Its hard to stop all the engineers from coding the wrong thing. Currently, the only indicator is a servere code slow down. I would prefer a more explicit indicator - a warning or blocked access. Thus, this thread. Scanning the user code is not that useful as many engineers will include (require/use) code from libraries. So, the check difficult. Its unfortunate that the test of "defined $&" causes the slow down. I will have to try the blocking tricks.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: detecting $& usage
by demerphq (Chancellor) on Jan 30, 2004 at 12:19 UTC

    I think you may want to reengineer what is happening a bit.

    Basically what im thinking is that you have a manager script that prepares all the appropriate stuff, and then spawns a new perl to actually run the engineer code. Thus the engineer code runs in a seperate process under a seperate perl every time. Youll get some slowdown from marshalling data between the manager script and the worker script, but it should be workable and overall resolve the problem of unexpected use of $&.

    Also with regard to your library usage, surely you can do a grep of your lib directories and simply remove or modify any library that has the offending vars in it. Obviously it would make your system non-standard, but it sounds like you have somewhat unusual requirements.


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi