Acme-Locals
view release on metacpan or search on metacpan
lib/Acme/Locals.pod view on Meta::CPAN
=head1 NAME
Acme::Locals - Interpolate like PythonE<sol>Ruby.
=head1 VERSION
This document describes Acme::Locals version v0.0.1
=head1 SYNOPSIS
# Python mode
use Acme::Locals qw(-python :all);
sub foo {
my $x = 10;
my $y = 100;
my $who = "world";
sayx '%(x)d %(y)d hello %(who)s!', locals();
}
# Ruby mode
use Acme::Locals qw(-ruby :all);
sub bar {
my $x = 10;
my $y = 100;
my $who = "world";
sayx '#{x} #{y} hello #{who}';
}
=head1 DESCRIPTION
This module let's you interpolate like Python and Ruby.
=head1 SUBROUTINESE<sol>METHODS
=head2 CLASS METHODS
=head3 C<<< sayx $format @fmt_vars >>>
printE<sol>puts like pythonE<sol>ruby.
=head3 C<<< printx $format @fmt_vars >>>
printf like pythonE<sol>ruby.
=head3 C<<< sprintx $format @fmt_vars >>>
sprintf like pythonE<sol>ruby.
=head3 C<<< locals() >>>
Return a hash of all lexical variables in the current scope. (Using
PadWalker).
=head3 C<<< globals() >>>
Return a hash of all global variables. (Using PadWalker).
=head3 C<<< lexicals() >>>
Alias to C<<< locals() >>>
=head2 PRIVATE CLASS METHODS
=head1 DIAGNOSTICS
=head1 CONFIGURATION AND ENVIRONMENT
This module requires no configuration file or environment variables.
=head1 DEPENDENCIES
=over
=item *
L<version>
=back
=over
=item *
L<PadWalker>
=back
=over
=item *
L<Params::Util>
=back
=head1 INCOMPATIBILITIES
None known.
=head1 BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests to
L<bug-acme-locals@rt.cpan.org|mailto:bug-acme-locals@rt.cpan.org>, or through the web interface at
L<CPAN Bug tracker|http://rt.cpan.org>.
=head1 SEE ALSO
=head1 AUTHOR
Ask Solem, L<ask@0x61736b.net>.
with thanks to sverrej for inspiration :)
=head1 LICENSE AND COPYRIGHT
( run in 2.304 seconds using v1.01-cache-2.11-cpan-97f6503c9c8 )