[svn:perlfaq] r10942 - perlfaq/trunk

[email protected] Tue, 18 Mar 2008 14:47:56 -0700 (PDT)
Newsgroups perl.cvs.perlfaq
Message-ID <[email protected]>
Author: comdog
Date: Tue Mar 18 14:47:55 2008
New Revision: 10942

Modified:
   perlfaq/trunk/perlfaq6.pod

Log:
* perlfaq6: How do I substitute case insensitively on the LHS while preserving case on the RHS?
	+ use $string instead of $a as a variable name
	+ this is the latest best practice since $a is special in a sort().


Modified: perlfaq/trunk/perlfaq6.pod
==============================================================================
--- perlfaq/trunk/perlfaq6.pod	(original)
+++ perlfaq/trunk/perlfaq6.pod	Tue Mar 18 14:47:55 2008
@@ -224,9 +224,9 @@
 			substr($mask, -1) x (length($new) - length($old))
     }
 
-	$a = "this is a TEsT case";
-	$a =~ s/(test)/preserve_case($1, "success")/egi;
-	print "$a\n";
+	$string = "this is a TEsT case";
+	$string =~ s/(test)/preserve_case($1, "success")/egi;
+	print "$string\n";
 
 This prints: