Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 about the Monastery: (11)
As of 2014-07-28 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (196 votes), past polls