Daniel Muey > fake > fake

Download:
fake-v0.0.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.0.1   Source  

NAME ^

fake - use a module and fake it if its not loadable

SYNOPSIS ^

  use fake warnings; # Keep older versions of Perl from trying to use lexical warnings

instead of

    BEGIN {
        # Keep older versions of Perl from trying to use lexical warnings
        $INC{'warnings.pm'} = "fake warnings entry for < 5.6 perl ($])" if $] < 5.006;
    }
    use warnings;

or

    eval 'use warnings;';
    $INC{'warnings.pm'} = "fake warnings entry for < 5.6 perl ($])" if $@;

DESCRIPTION ^

If a module is not available, it quietly fake's the %INC entry so that it will be seen as loaded later. If it is available its use'd as normal as if you'd just done 'use mod;'

This example SYNOPSIS illustrates how you'd 'use warnings;' when available and not use it when its not.

SEE ALSO ^

first

AUTHOR ^

Daniel Muey, http://drmuey.com/cpan_contact.pl

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 by Daniel Muey

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.