Acme::Your - not our variables, your variables


Acme-Your documentation Contained in the Acme-Your distribution.

Index


Code Index:

NAME

Top

Acme::Your - not our variables, your variables

SYNOPSIS

Top

    use Data::Dumper;
    use Acme::Your "Data::Dumper";

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

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

DESCRIPTION

Top

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"

    my $foo = "bar";

    {
        your $foo = "wilma";
        print $foo;  # prints "wilma"
    }

    print $foo;      # prints "foo"
    print $Fred::foo # prints "wilma"

Your allows you to import symbols from other packages into your own lexical scope and have access to them.

BUGS

Top

Acme::Your functions by parsing your source code and filtering it with a source filter. It is possible to fool the parser with some pathelogical cases and you should be aware that this module faces all the standard problems that perl faces when parsing Perl Code.

VERSION

Top

Acme::Your 0.01 was released on 14th January 2002.

AUTHOR

Top

Richard Clamp <richardc@unixbeard.net>

Original idea, documentation, and tests which kill, Mark Fowler <mark@twoshortplanks.com>

COPYRIGHT

Top

SEE ALSO

Top

Filter::Simple, Parse::RecDescent.


Acme-Your documentation Contained in the Acme-Your distribution.

package Acme::Your;
use strict;
use warnings;
require v5.6;

use vars qw/$VERSION $into/;
$VERSION = '0.01';

sub import {
    my $self = shift;
    return unless @_;
    $into = shift;

    # slide around damians cunning - our import needs to go first
    require Acme::Your::Filter;
    Acme::Your::Filter->import();
}

1;
__END__