Giter VIP home page Giter VIP logo

cycle-detect's Introduction

NAME
    Cycle-Detect - (mostly) Non-global use/require cycle detection

DESCRIPTION
    When this module is loaded into a package, Cycle Detection is started.
    Cycle detection will issue a highly readable warnings whenever a use
    cycle is detected. Detection will only trigger warnings when the cycle
    starts in a module that has used Cycle::Detect. In addition you can
    choose to use Cycle::Detect to load a module, effectively limiting the
    detection to the scope of that one load.

    Example Warnings:

        [Cycle Detection started in 'My::Package']
        Use Cycle Detected. Require Stack:
          * CycleA.pm
            CycleB.pm
            CycleC.pm
          * CycleA.pm

    The warning tells you which package started the cycle-detection. It then
    displays the require stack. It adds an asterisk before the module that
    is cycling. This readout is handy because it lets you trace exactly how
    the cycle occurs.

SYNOPSYS
  PACKAGE SCOPE
        package My::Package;
        use strict;
        use warnings;

        use Cycle::Detect;
        use Something::That::Cycles qw/my_import/;

        # Detection only tirggers on use/require in a package that imported
        # Cycle::Detect. The code below will not report the cycle.
        {
            package My::Other::Package
            use Another::Cycle;
        }

        ...

        no Cycle::Detect; # Optional, turns off detection for this package

  SINGLE LOAD
        package My::Package;
        use strict;
        use warnings;

        # Check for cycles when loading (and importing) a module:
        use Cycle::Detect 'Something::That::Cycles', qw/my_import/;
        # Cycle detection is not active beyond the previous line.

CAVEATS
    This module works by overriding "CORE::GLOBAL::require". It tries to be
    nice about it. If it has already been overriden, all efforts will be
    taken to wrap around it. However if something else overrides it after
    this module, and is not nice about wrapping, the detection will stop
    working.

SEE ALSO
    circular::require - A discussion about this module is what spawned the
    idea for Cycle::Detect. Both modules detect cycles, but take radically
    different approaches. circular::require works like a pragma: "no
    circular::require" and simply prints the module that is cycled. It is
    also completely global.

AUTHORS
    Chad Granum [email protected]

COPYRIGHT
    Copyright (C) 2012 Chad Granum

    Cycle-Detect is free software; Standard perl licence.

    Cycle-Detect is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for
    more details.

cycle-detect's People

Contributors

exodist 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.