Karen Etheridge 🐾 🌋
and 1 contributors

NAME

Devel::INC::Sorted - Keep your hooks in the beginning of @INC

VERSION

version 0.03

SYNOPSIS

        use Devel::INC::Sorted qw(inc_add_floating);

        inc_add_floating( \&my_inc_hook );
        unshift @INC, \&other_hook;

        use lib 'blah';

        push @INC, 'foo';

        warn $INC[0]; # this is still \&my_inc_hook
        warn $INC[3]; # but \&other_hook was moved down to here

DESCRIPTION

This module keeps @INC sorted much like Tie::Array::Sorted.

The default comparison operator partitions the members into floating and non floating, allowing you to easily keep certain hooks in the beginning of @INC.

The sort used is a stable one, to make sure that the order of @INC for unsorted items remains unchanged.

EXPORTS

All exports are optional

inc_add_floating

Add entries to @INC and call inc_float_entry on them.

inc_float_entry

Mark the arguments as floating (in the internal hashref).

inc_unfloat_entry

Remove the items from the hash.

untie_inc

Untie @INC, leaving all it's current elements in place. Further modifications to @INC will not cause resorting to happen.

SUPPORT

Bugs may be submitted through the RT bug tracker (or bug-Devel-INC-Sorted@rt.cpan.org).

AUTHOR

יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>

CONTRIBUTOR

Karen Etheridge <ether@cpan.org>

COPYRIGHT AND LICENCE

This software is copyright (c) 2008 by יובל קוג'מן (Yuval Kogman).

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