Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 84d2f34

A small refactoring of the _conversion interface to distinguish between the
conversion prefix and its letter.

  • Participants
  • Parent commits 6e0c4bd

Comments (0)

Files changed (1)

File modules/Text-Sprintf-Named/lib/Text/Sprintf/Named.pm

 
     my $format = $self->_fmt;
 
-    $format =~ s/%(%|\(([a-zA-Z_]\w*)\)([\+\-\.\d]*[DEFGOUXbcdefgiopsux]))/
+    $format =~ s/%(%|\(([a-zA-Z_]\w*)\)([\+\-\.\d]*)([DEFGOUXbcdefgiopsux]))/
         $self->_conversion({
             format_args => $args,
             named_params => $named_params,
             conv => $1,
             name => $2,
-            conv_raw => $3,
+            conv_prefix => $3,
+            conv_letter => $4,
         })
         /ge;
 
     }
     else
     {
-        return sprintf(("%" . $args->{conv_raw}),
+        return sprintf(("%" . $args->{conv_prefix} . $args->{conv_letter}),
             $args->{named_params}->{$args->{name}}
         );
     }