Acme::StringFormat - Smart interface to sprintf()


Acme-StringFormat documentation  | view source Contained in the Acme-StringFormat distribution.

Index


NAME

Top

Acme::StringFormat - Smart interface to sprintf()

VERSION

Top

This document describes Acme::StringFormat version 0.04

SYNOPSIS

Top

    use Acme::StringFormat;

    # enable 'sprintf' operator in the scope

    say '[%s][%s]' % 'foo' % 'bar'; # => [foo][bar]




DESCRIPTION

Top

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.

INTERFACE

Top

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;

DIAGNOSTICS

Top

Arguments mismatch for Acme::StringFormat

(W printf) Too few format parameters or too many format arguments.

CONFIGURATION AND ENVIRONMENT

Top

Acme::StringFormat requires no configuration files or environment variables.

DEPENDENCIES

Top

Perl 5.10.0 or later, and a C compiler.

BUGS AND LIMITATIONS

Top

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/.

SEE ALSO

Top

sprintf in perlfunc - this module is an interface to sprintf.

The following languages (or libraries) also provide % format operators:

C++

http://www.boost.org/.

Ruby

http://www.ruby-lang.org/.

Python

http://www.python.org/.

AUTHOR

Top

Goro Fuji <gfuji(at)cpan.org>.

LICENSE AND COPYRIGHT

Top


Acme-StringFormat documentation  | view source Contained in the Acme-StringFormat distribution.