Test-Harness
view release on metacpan or search on metacpan
$useOrigOpen = $useOrigClose = 1;
# taken from http://www.perl.com/pub/a/2002/06/11/threads.html?page=2
*CORE::GLOBAL::open = \&my_open;
sub my_open (*@) {
if ($useOrigOpen) {
if ( defined( $_[0] ) ) {
use Symbol qw();
my $handle = Symbol::qualify( $_[0], (caller)[0] );
no strict 'refs';
if ( @_ == 1 ) {
return CORE::open($handle);
}
elsif ( @_ == 2 ) {
return CORE::open( $handle, $_[1] );
}
else {
die "Can't open with more than two args";
}
( run in 1.505 second using v1.01-cache-2.11-cpan-a3c8064c92c )