Acme-Tie-Formatted

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

Acme-Tie-Formatted version 0.03

Creates a global hash, %format,  that you can use to embed sprintf formatting
in a standard print(), like this:

  print "The value is $format{$value, "09.3d"}\n";

INSTALLATION

To install this module, run the following commands:

    perl Makefile.PL
    make

lib/Acme/Tie/Formatted.pm  view on Meta::CPAN

=head1 SYNOPSIS

    use Acme::Tie::Formatted;
    print "The value is $format{$number, "%3d"} ",
          "(or $format{$number, "%04x"} in hex)\n";

    print "some numbers: $format{ 12, 492, 1, 8753, "%04d"}\n";

=head1 DESCRIPTION

This module creates a global read-only hash, C<%format>, for formatting
data items with standard C<sprintf> format specifications. Since it's a
hash, you can interpolate it into strings as well as use it standalone.

The hash should be "accessed" with two or more "keys". The last key
is interpreted as a C<sprintf> format for each data item specified in the
preceeding arguments. This allows you to format multiple items at once
using the same format for each.

=head2 Alternate name



( run in 0.563 second using v1.01-cache-2.11-cpan-49f99fa48dc )