Acme-Your

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        your $Varname;  # This is really $Data::Dumper::Varname

        print "The default variable name for DD is $Varname";

DESCRIPTION
    Acme::Your gives you a language construct "your" that behaves similarly
    to Perl's own "our" constuct. Rather than defining lexically unqualified
    varibles to be in our own package however, you can define lexically
    unqualified variable to be from anothter package namespace entirely.

    It all starts with the use statement.

        use Acme::Your "Some::Package";

    This both 'imports' the your construct and states the package that any
    variables defined with a your statement will be created in.

    Then you can do 'your' statements. Note that these are lexical, and fall
    out of scope much the same way that our variables would. For example

        use Acme::Your "Fred"

lib/Acme/Your.pm  view on Meta::CPAN

    print "The default variable name for DD is $Varname";

=head1 DESCRIPTION

Acme::Your gives you a language construct "your" that behaves
similarly to Perl's own "our" constuct.  Rather than defining
lexically unqualified varibles to be in our own package however, you
can define lexically unqualified variable to be from anothter package
namespace entirely.

It all starts with the use statement.

    use Acme::Your "Some::Package";

This both 'imports' the your construct and states the package that any
variables defined with a your statement will be created in.

Then you can do 'your' statements.  Note that these are lexical, and
fall out of scope much the same way that our variables would.  For
example

t/04multipleassign.t  view on Meta::CPAN

use Acme::Your 'Foo';

package Foo;
use vars qw( $foo $bar );

$foo = 'foo';
$bar = 'bar';

package main;

is( $Foo::foo, 'foo', "remote start foo" );
is( $Foo::bar, 'bar', "remote start bar" );

{
    your ($foo, $bar) = qw( baz quux );
    is( $foo, 'baz', "inner local foo" );
    is( $bar, 'quux', "inner local bar" );
    is( $Foo::foo, 'baz', "inner remote foo" );
    is( $Foo::bar, 'quux', "inner remote bar" );
}

is( $Foo::foo, 'foo', "remote end foo" );



( run in 0.319 second using v1.01-cache-2.11-cpan-0d8aa00de5b )