Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    namespace::autoclean 0.13

    Download button

    No screenshots available
    Downloads: 248  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Florian Ragwitz | More programs
    Perl Artistic License / FREE
    November 8th, 2011, 05:28 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    namespace::autoclean description

    Keep imports out of your namespace

    When you import a function into a Perl package, it will naturally also be available as a method.

    namespace::autoclean is a Perl module that will remove all imported symbols at the end of the current package's compile cycle. Functions called in the package itself will still be bound by their name, but they won't show up as methods on your class or instances.

    This module is very similar to namespace::clean, except it will clean all imported functions, no matter if you imported them before or after you used the pagma. It will also not touch anything that looks like a method, according to Class::MOP::Class::get_method_list.

    If you're writing an exporter and you want to clean up after yourself (and your peers), you can use the -cleanee switch to specify what package to clean:

     package My::MooseX::namespace::autoclean;
     use strict;

     use namespace::autocleanclean (); # no cleanup, just load

     sub import {
     namespace::autoclean->import(
     -cleanee => scalar(caller),
     );
     }


    SYNOPSIS

     package Foo;
     use namespace::autoclean;
     use Some::Package qw/imported_function/;

     sub bar { imported_function('stuff') }

     # later on:
     Foo->bar; # works
     Foo->imported_function; # will fail. imported_function got cleaned after compilation



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    namespace cleaner | clean namespace | Perl module | namespace | cleaner | autoclean

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM