Coder Social home page Coder Social logo

authority's Introduction

NAME
    authority - loads a module only if it has a particular authority

SYNOPSIS
     use authority 'cpan:STEVAN', Moose => qw();
     use authority 'cpan:TOBYINK', HTML::HTML5::Builder => qw(:standard);

DESCRIPTION
    This pragma allows you to indicate that you wish to load a module only if
    its authority is a particular URI.

    Using this pragma automatically enables UNIVERSAL::AUTHORITY.

    `use authority $authority, $module, @arguments`
        Require and import the module at compile time. This is the usual mode
        of operation.

    `authority->import($authority, $module, @arguments)`
        Require and import the module at run time.

    Note that the special $authority value "Any", indicates that any authority
    is allowed (including undef).

    Experimentally, $module may contain a module name and minimum version,
    separated with a space.

    There is also a very experimental feature allowing releases of the same
    package by different authorities to live side-by-side, though only one of
    them can be required into a running script.

    In this case, assuming that the inc path is `/opt/perl/lib` and a script
    does this:

     use authority 'cpan:JOE', My::Module => qw();

    Then Perl will attempt to load `/opt/perl/lib/cpan_3A_JOE/My/Module.pm`
    before it tries the usual `/opt/perl/lib/My/Module.pm`.

    This is not anywhere near as powerful as the authority feature of Perl 6,
    but it's a start.

BUGS
    Please report any bugs to
    <http://rt.cpan.org/Dist/Display.html?Queue=authority>.

SEE ALSO
    *   Object::AUTHORITY - an AUTHORITY method for your class

    *   authority::shared - a more sophisticated AUTHORITY method for your
        class

    *   UNIVERSAL::AUTHORITY - an AUTHORITY method for every class
        (deprecated)

    *   UNIVERSAL::AUTHORITY::Lexical - an AUTHORITY method for every class,
        within a lexical scope

    *   *authority* (this module) - load modules only if they have a
        particular authority

    Background reading: <http://feather.perl6.nl/syn/S11.html>,
    <http://www.perlmonks.org/?node_id=694377>.

AUTHOR
    Toby Inkster <[email protected]>.

COPYRIGHT AND LICENCE
    This software is copyright (c) 2011 by Toby Inkster.

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

DISCLAIMER OF WARRANTIES
    THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
    WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
    MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

authority's People

Contributors

tobyink avatar

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.