1. Shlomi Fish
  2. perl-Text-Sprintf

Commits

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

Extracted the ->_sprintf() method for easy over-ridability.

  • Participants
  • Parent commits 84d2f34
  • Branches default

Comments (0)

Files changed (1)

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

View file
     }
     else
     {
-        return sprintf(("%" . $args->{conv_prefix} . $args->{conv_letter}),
+        return $self->_sprintf(
+            ("%" . $args->{conv_prefix} . $args->{conv_letter}),
             $args->{named_params}->{$args->{name}}
         );
     }
 }
 
+sub _sprintf
+{
+    my ($self, $format, @args) = @_;
+
+    return sprintf($format, @args);
+}
+
 =head1 EXPORT
 
 A list of functions that can be exported.  You can delete this section