Acme::StringFormat - Smart interface to sprintf()
This document describes Acme::StringFormat version 0.04
use Acme::StringFormat; # enable 'sprintf' operator in the scope say '[%s][%s]' % 'foo' % 'bar'; # => [foo][bar]
I had a desire for a "format operator" of other languages. Take boost C++ libraly for example:
using namespace boost; std::cout << format("[%1%][%2]") % "foo" % "bar" << std::endl;
Now this pragmatic module provides Perl with a format operator %, which is equivalent to sprintf.
%
sprintf
use Acme::StringFormat;
Enables the sprintf operator in the rest of the scope;
no Acme::StringFormat;
Disables the sprintf operator in the rest of the scope;
Arguments mismatch for Acme::StringFormat
(W printf) Too few format parameters or too many format arguments.
Acme::StringFormat requires no configuration files or environment variables.
Perl 5.10.0 or later, and a C compiler.
No bugs have been reported.
Please report any bugs or feature requests to bug-acme-stringformat@rt.cpan.org/, or through the web interface at http://rt.cpan.org/.
bug-acme-stringformat@rt.cpan.org/
"sprintf" in perlfunc - this module is an interface to sprintf.
The following languages (or libraries) also provide % format operators:
http://www.boost.org/.
http://www.ruby-lang.org/.
http://www.python.org/.
Goro Fuji <gfuji(at)cpan.org>.
Copyright (c) 2008, Goro Fuji <gfuji(at)cpan.org>. Some rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Acme::StringFormat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::StringFormat
CPAN shell
perl -MCPAN -e shell install Acme::StringFormat
For more information on module installation, please visit the detailed CPAN module installation guide.