Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Testing failures: How to override print to make it fail?

by eyepopslikeamosquito (Canon)
on May 05, 2005 at 03:00 UTC ( #454223=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    BEGIN {
        *CORE::GLOBAL::open = sub (*;$$) { return undef };
    }
    open(my $fh, '>', 'f.tmp') or die "error: open";
    print $fh "hello\n" or die "error: print";
    
  2. or download this
    BEGIN {
        *CORE::GLOBAL::print = sub (*;@) { return undef };
    }
    open(my $fh, '>', 'f.tmp') or die "error: open";
    print $fh "hello\n" or die "error: print";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://454223]
Approved by tlm
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (17)
As of 2014-07-29 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (223 votes), past polls