develooper Front page | perl.perl5.porters | Postings from December 2004

$Config{extensions} !~ /\bSome\/Module\b/ or eval {require Some::Module}

Thread Next
From:
Michael G Schwern
Date:
December 8, 2004 22:41
Subject:
$Config{extensions} !~ /\bSome\/Module\b/ or eval {require Some::Module}
Message ID:
20041209045856.GD1164@windhund.schwern.org
Why do the tests do this:

        require Config; import Config;
        if ($Config{'extensions'} !~ /\bData\/Dumper\b/) {
            print "1..0 # Skip: Data::Dumper was not built\n";
            exit 0;
        }

When it would seem to be a whole lot less obfuscated to do this:

	if( eval { require Data::Dumper } ) {
	    print "1..0 # Skip: Data::Dumper not available\n";
	    exit;
	}


-- 
Michael G Schwern        schwern@pobox.com  http://www.pobox.com/~schwern/
If God made anything more guerrila than your breast, I hope he kept it for
your father.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About