Just a thought

Kevin Spicer kevins at BMRB.CO.UK
Sat Mar 6 17:29:43 GMT 2004


On Sat, 2004-03-06 at 16:54, Julian Field wrote:
> I thought it only made a difference for regexps that include variables. I
> had hoped that regexps including only static texts would only be compiled
> once. Anything in the Perl docs to back either of our views?
>
According to 'Programming Perl' the /o modifier prevents recompilation
of the regular expression when it contains an interpolated variable
(ref. p.148).  So you are correct.  There is a great section on
optimisation techniques in that book.  With its help I was able to
optimise a program I wrote (which is responsible for mirroring certain
types of files between a local disk and a remote ftp server) from taking
a few minutes to taking a few seconds  (this is probably a reflection on
the poor quality of my original code as much as anything else!).




BMRB International
http://www.bmrb.co.uk
+44 (0)20 8566 5000
_________________________________________________________________
This message (and any attachment) is intended only for the
recipient and may contain confidential and/or privileged
material.  If you have received this in error, please contact the
sender and delete this message immediately.  Disclosure, copying
or other action taken in respect of this email or in
reliance on it is prohibited.  BMRB International Limited
accepts no liability in relation to any personal emails, or
content of any email which does not directly relate to our
business.



More information about the MailScanner mailing list