last - use the last loadable module in a list


last documentation Contained in the last distribution.

Index


Code Index:

NAME

Top

last - use the last loadable module in a list

SYNOPSIS

Top

  use last 'Foo', 'Bar', 'Baz';

DESCRIPTION

Top

use() the last module in the given list

The SYNOPSIS example is exactly the same as doing:

  use first 'Baz', 'Bar', 'Foo';

In fact the list after 'use last' can contain the same things as first and the same variables are available for use after the call (only with the last:: name space instead of first:: of course)

Useful for when you have a list of modules that you could use that are in least desirable to most desireable order.

SEE ALSO

Top

first

AUTHOR

Top

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

COPYRIGHT AND LICENSE

Top


last documentation Contained in the last distribution.

package last;

use strict;
use warnings;

use Carp;
use version;our $VERSION = qv('0.0.1');

our $module;
our $failed = {};

sub import {
    shift;
    local $UNIVERSAL::Level = $UNIVERSAL::Level + 1; 
    local $Carp::CarpLevel  = $Carp::CarpLevel  + 1;
    use first reverse @_;   
    $module = $first::module;
    $failed = $first::failed;
}

1;

__END__