MediaCloud-JobManager

 view release on metacpan or  search on metacpan

lib/MediaCloud/JobManager/Worker.pm  view on Meta::CPAN

{
    my ( $path_or_name ) = shift;

    eval {
        if ( $path_or_name =~ /\.pm$/ )
        {
            # /somewhere/Foo/Bar.pm

            # Expect the package to return its name so that we'll know how to call it:
            # http://stackoverflow.com/a/9850017/200603
            $path_or_name = require $path_or_name;
            if ( $path_or_name . '' eq '1' )
            {
                LOGDIE( "The function package should return __PACKAGE__ at the end of the file instead of just 1." );
            }
            $path_or_name->import();
            1;
        }
        else
        {
            # Foo::Bar



( run in 0.373 second using v1.01-cache-2.11-cpan-05444aca049 )