NAME

Class::Load::Tiny - a working (require "Class::Name") and (not much) more

VERSION

version 0.02

SYNOPSIS

use Class::Load::Tiny ':all';

try_load_class('Class::Name')
    or plan skip_all => "Class::Name required to run these tests";

load_class('Class::Name');

is_class_loaded('Class::Name');

DESCRIPTION

Class::Load::Tiny is a minimal implementation of some of the functions of Class::Load. It is only meant to provide an almost dependency-free version of the "core" of Class::Load. If you don't need to avoid some more dependencies in your code, you should probably use Class::Load instead.

SUBROUTINES

load_class( $class )

Load $class or throw an error, much like require.

try_load_class( $class )

Load $class and return 1, or 0 if there was an error. In list context, also return the error string as a second value.

is_class_loaded( $class )

Check if $class is already loaded. Note that, by default, this only checks if the file named after $class (e.g. Module/Name.pm) is in %INC.

If Package::Stash is installed this function will act just like the more advanced and reliable one from Class::Load.

INTERNAL METHODS

_module_file_from_class( $class )

Convert $class from Module::Name to Module/Name.pm.

_check_class_name( $class )

Return 0. 0 and $error in list context.

_error( $error )

Return 0. 0 and $error in list context.

AUTHOR

Alessandro Ghedini <alexbio@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2011 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.