[Bps-public-commit] r9207 - Text-Quoted

ruz at bestpractical.com ruz at bestpractical.com
Wed Oct 3 07:03:48 EDT 2007


Author: ruz
Date: Wed Oct  3 07:03:39 2007
New Revision: 9207

Modified:
   Text-Quoted/   (props changed)
   Text-Quoted/Quoted.pm

Log:
 r18263 at cubic-pc:  cubic | 2007-10-03 14:29:42 +0400
 * use a match regexp instead of substitute
 * combine two regexps into one


Modified: Text-Quoted/Quoted.pm
==============================================================================
--- Text-Quoted/Quoted.pm	(original)
+++ Text-Quoted/Quoted.pm	Wed Oct  3 07:03:39 2007
@@ -176,14 +176,10 @@
 
     foreach (splice @lines) {
         my %line = ( raw => $_ );
-        s/\A *($quoter?)( *)//;
-        $line{quoter}     = $1;
-        $line{hang} = Hang->new($_);
-
-        s/( *)(.*?)(\s*)$//;
-        $line{text}      = $2;
-        $line{empty}     = $line{hang}->empty() && $2 !~ /\S/;
-        $line{separator} = $line{text} =~ /^$separator$/;
+        @line{'quoter', 'text'} = (/\A *($quoter?) *(.*?)\s*\Z/o);
+        $line{hang}      = Hang->new( $line{'text'} );
+        $line{empty}     = $line{hang}->empty() && $line{'text'} !~ /\S/;
+        $line{separator} = $line{text} =~ /^$separator$/o;
         push @lines, \%line;
     }
 



More information about the Bps-public-commit mailing list