The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

lib::tiny - use lib, without having to use memory by loading Config

VERSION

This document describes lib::tiny version 0.7

SYNOPSIS

    use lib::tiny @list;
    no lib::tiny @list;

DESCRIPTION

This module simply adds and removes the given (existant on add) paths as-is to/from @INC in the same manner as lib but in a '::Tiny' manner.

The idea is this: lib.pm has to load the entire %Config and only uses 3 small variables from it.

As far as I can tell Config still gets use()d in lib even if perl was compiled with PERL_BUILD_EXPAND_CONFIG_VARS

Also the assumption is that if you are using this to shave off a bit of memory (appx 200K +/- over 'use lib') then you are probably not interested in the arch/version/inc_version_list alternate paths anyway.

That being the case it doesn't bother with them since it'd require Config and also more memory for File::Spec.

For the same reason we don't have a @lib::tiny::ORIG_INC copy

If you are interested in those things just use lib instead.

METHODS

import()

Is used when you:

    use lib::tiny @list;

unimport()

Is used when you:

   no lib::tiny @list;

CONFIGURATION AND ENVIRONMENT

lib::tiny requires no configuration files or environment variables.

DEPENDENCIES

None.

INCOMPATIBILITIES

None reported.

SEE ALSO

lib::findbin, lib::tiny::findbin

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-lib-tiny@rt.cpan.org, or through the web interface at http://rt.cpan.org.

A NOTE ABOUT TINY MEMORY

Here are some quick tests to showing how it uses over 50% less memory than use lib; (at least at this moment on this machine, your mileage may vary obviously)

    multivac:~ dmuey$ perl -le 'print `ps u -p $$`;'
    USER    PID %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
    dmuey 12815   0.0  0.1   601232   1172 s001  S+    5:07PM   0:00.01 perl -le print `ps u -p $$`;
    
    multivac:~ dmuey$ perl -le 'use lib "/tmp";print `ps u -p $$`;'
    USER    PID %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
    dmuey 12817   2.7  0.1   601232   1544 s001  S+    5:08PM   0:00.01 perl -le use lib "/tmp";print `ps u -p $$`;
    
    multivac:~ dmuey$ perl -le 'use lib::tiny "/tmp";print `ps u -p $$`;'
    USER    PID %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
    dmuey 12819   0.0  0.1   601232   1360 s001  S+    5:08PM   0:00.01 perl -le use lib::tiny "/tmp";print `ps u -p $$`;
    
    multivac:~ dmuey$ perl -le 'print 1544 - 1172;'
    372
    multivac:~ dmuey$ perl -le 'print 1360 - 1172;'
    188
    multivac:~ dmuey$ perl -le 'print ((188/372)*100);'
    50.5376344086022
    multivac:~ dmuey$

TODO

If there is great demand we may:

Do the archtype/version/inc_version_list dir structure without needing Config or File::Spec?

or at least a mechanism to pass the data and have it done?

THANKS

To Adam Kennedy for the helpful feedback to make this module actually fit in the '::Tiny' spec.

AUTHOR

Daniel Muey <http://drmuey.com/cpan_contact.pl>

LICENCE AND COPYRIGHT

Copyright (c) 2008, Daniel Muey <http://drmuey.com/cpan_contact.pl>. All rights reserved.

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

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.