Devel::INC::Sorted - Keep your hooks in the begining of @INC
@INC
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
This module keeps @INC sorted much like Tie::Array::Sorted.
The default comparator partitions the members into floating and non floating, allowing you to easily keep certain hooks in the begining of @INC.
The sort used is a stable one, to make sure that the order of @INC for unsorted items remains unchanged.
All exports are optional
Add entries to @INC and call inc_float_entry on them.
inc_float_entry
Mark the arguments as floating (in the internal refhash).
Remove the items from the hash.
Untie @INC, leaving all it's current elements in place. Further modifications to @INC will not cause resorting to happen.
This module is maintained using Darcs. You can get the latest version from http://nothingmuch.woobling.org/code, and use darcs send to commit changes.
darcs send
Yuval Kogman <nothingmuch@woobling.org>
Copyright (c) 2008 Yuval Kogman. All rights reserved This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Devel::INC::Sorted, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::INC::Sorted
CPAN shell
perl -MCPAN -e shell install Devel::INC::Sorted
For more information on module installation, please visit the detailed CPAN module installation guide.