Giter VIP home page Giter VIP logo

exporter-simple's Introduction

NAME
    Exporter::Simple - Easier set-up of module exports

SYNOPSIS
      package MyExport;
      use base 'Exporter::Simple';

      our @bar : Exportable(vars) = (2, 3, 5, 7);
      our $foo : Exported(vars)   = 42;
      our %baz : Exported         = (a => 65, b => 66);

      sub hello : Exported(greet,uk)   { "hello there" }
      sub askme : Exportable           { "what you will" }
      sub hi    : Exportable(greet,us) { "hi there" }

      # meanwhile, in a module far, far away
      use MyExport qw(:greet);
      print hello();
      $baz{c} = 67;

DESCRIPTION
    This module, when subclassed by a package, allows that package to define
    exports in a more concise way than using "Exporter". Instead of having
    to worry what goes in @EXPORT, @EXPORT_OK and %EXPORT_TAGS, you can use
    two attributes to define exporter behavior. This has two advantages: It
    frees you from the implementation details of "Exporter", and it keeps
    the export definitions where they belong, with the subroutines and
    variables.

    The attributes provided by this module are:

    "Exported"
        Indicates that the associated subroutine or global variable should
        be automatically exported. It will also go into the ":all" tag (per
        the rules of %EXPORT_TAGS), as well as any tags you specify as
        options of this attribute.

        For example, the following declaration

          sub hello : Exported(greet,uk)   { ... }

        will cause "hello()" to be exported, but also be available in the
        tags ":all", ":greet" and ":uk".

    "Exportable"
        Is like "Exported", except that the associated subroutine or global
        variable won't be automatically exported. It will still go to the
        ":all" tag in any case and all other tags specified as attribute
        options.

BUGS
    If you find any bugs or oddities, please do inform the author.

INSTALLATION
    See perlmodinstall for information and options on installing Perl
    modules.

AVAILABILITY
    The latest version of this module is available from the Comprehensive
    Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a
    CPAN site near you. Or see
    <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.

VERSION
    This document describes version 1.10 of "Exporter::Simple".

AUTHOR
    Marcel Grünauer <[email protected]>

CONTRIBUTORS
    Damian Conway <[email protected]>

    Richard Clamp <[email protected]>

COPYRIGHT
    Copyright 2001-2002 Marcel Grünauer. All rights reserved.

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

SEE ALSO
    perl(1), Attribute::Handlers(3pm), Exporter(3pm).

exporter-simple's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.