perl.cvs.perlfaq
[Top] [All Lists]

[svn:perlfaq] r11384 - perlfaq/trunk

Subject: [svn:perlfaq] r11384 - perlfaq/trunk
From: comdog@xxxxxxxxxxxx
Date: Sat, 7 Jun 2008 08:15:29 -0700 (PDT)
Newsgroups: perl.cvs.perlfaq

Author: comdog
Date: Sat Jun  7 08:15:28 2008
New Revision: 11384

Modified:
   perlfaq/trunk/perlfaq6.pod

Log:
* Why does using $&, $`, or $' slow my program down?
        + add a paragraph about the new PErl 5.10 variables for
        these guys: C<${^MATCH}>, C<${^PREMATCH}>, and C<${^POSTMATCH}>


Modified: perlfaq/trunk/perlfaq6.pod
==============================================================================
--- perlfaq/trunk/perlfaq6.pod  (original)
+++ perlfaq/trunk/perlfaq6.pod  Sat Jun  7 08:15:28 2008
@@ -807,6 +807,11 @@
 essentially the same information, but without the risk of excessive
 string copying.
 
+Perl 5.10 added three specials, C<${^MATCH}>, C<${^PREMATCH}>, and
+C<${^POSTMATCH}> to do the same job but without the global performance
+penalty. Pelr only sets these variables if you compile or execute the
+regular expression with the C</p> modifier.
+
 =head2 What good is C<\G> in a regular expression?
 X<\G>
 

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:perlfaq] r11384 - perlfaq/trunk, comdog <=