Is Perl *that* good?

Roy Smith roy at panix.com
Tue Apr 27 20:35:51 EDT 2004


In article <ECCjc.30580$Vp5.25085 at fe2.columbus.rr.com>,
 Carl Banks <imbosol at aerojockey.invalid> wrote:

> It's worse because, unlike most objects, regexp objects are usually
> global (at least they are when I use them).  Moreover, the library
> encourages us to make regexp objects global by exposing the regexp
> compiler.  So even if you personally use local regexps (and accept the
> resulting performance hit), many will declare them global.

I don't see why regexps are usually global.  Nor do I see why exposing 
the compiler encourages them to be global, or why making them local 
should result in a performance hit.

I do a lot of regex work.   I just looked over a bunch of scripts I 
happen to have handy and only found one where I used global regexp 
objects.  In that script, the regexps were only used in a single 
routine, so moving them down in scope to be local to that routine would 
have made more sense anyway.  Looking back at the code, which I wrote 
several years ago, I have no idea why I decided to make them global.



More information about the Python-list mailing list