in reply to Re: Never
in thread Never-to-use Perl features?

The speed differences are small enough to be irrelevant for almost all real world situations. The important difference is that qr// is a clear and fairly obvious modifier, which /o does something totally bizarre, i.e. the first time a regex with /o runs it will do one thing and every other time it will do something different. This frequently wreaks havoc in persistent environments like mod_perl where people forget that /o regexes will not get reset after their script finishes.

Replies are listed 'Best First'.
Re: Re: Re: Never
by grantm (Parson) on May 13, 2003 at 08:45 UTC
    the first time a regex with /o runs it will do one thing and every other time it will do something different

    Actually every other time it will do the same thing despite many people expecting it to do something different :-)

    All flippancy aside though, your point re persistent environments is a good one that I hadn't considered. Mind you, persistent environments wreak all sorts of havoc with file scoped lexicals too but that doesn't mean they're inherently a bad idea - it just means you need to use them with caution.