namespace::local above, below, and around

My namespace::local module has got some new switches in v.0.04:

  • -above (0.04) emulates namespace::clean:

    package My::Package;
    use Lots::Of::Imports; # imports will only be available until end of scope
    use namespace::local -above;
    
    
    sub do_things { ... }; # this will not be hidden
    
  • -below (0.03) hides everything that follows it from outside view:

    package My::Package;
    sub public { ... };
    use namespace::local -below;
    sub private { ... }; # not available outside this module
    
  • default mode still confines imports and/or functions between the use line and end of scope:

    package My::Package;
    
    
    # cannot frobnicate here
    {
        use namespace::local;
        use Some::Crazy::DSL;
        frobnicate Foo => 42;
    }
    # can't frobnicate here, too
    

I also added a list of symbols that this module shall not be fiddling with, which is most likely incomplete.

Still it looks more like an Acme:: toy, to be honest. Who needs to hide their private functions? Just document the public ones to the point where nobody cares to look inside! =)

Have fun.

Leave a comment

About Konstantin Uvarin

user-pic A humble Perl developer