Acme-Locals

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME
    Acme::Locals - Interpolate like Python/Ruby.

VERSION
    This document describes Acme::Locals version v0.0.1

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}';
         }

DESCRIPTION
    This module let's you interpolate like Python and Ruby.

SUBROUTINES/METHODS
  CLASS METHODS
   "sayx $format @fmt_vars"
    print/puts like python/ruby.

   "printx $format @fmt_vars"
    printf like python/ruby.

   "sprintx $format @fmt_vars"
    sprintf like python/ruby.

   "locals()"
    Return a hash of all lexical variables in the current scope. (Using
    PadWalker).

   "globals()"
    Return a hash of all global variables. (Using PadWalker).

   "lexicals()"
    Alias to "locals()"

  PRIVATE CLASS METHODS
DIAGNOSTICS
CONFIGURATION AND ENVIRONMENT
    This module requires no configuration file or environment variables.

DEPENDENCIES
    *   version

    *   PadWalker

    *   Params::Util

INCOMPATIBILITIES
    None known.

BUGS AND LIMITATIONS
    No bugs have been reported.

    Please report any bugs or feature requests to
    bug-acme-locals@rt.cpan.org, or through the web interface at CPAN Bug
    tracker.

SEE ALSO
AUTHOR
    Ask Solem, ask@0x61736b.net.

    with thanks to sverrej for inspiration :)

LICENSE AND COPYRIGHT
    Copyright (c), 2007 Ask Solem ask@0x61736b.net.

    "Acme::Locals" is distributed under the Modified BSD License.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are
    met:

    1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
    derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN



( run in 0.635 second using v1.01-cache-2.11-cpan-98e64b0badf )