Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
good chemistry is complicated,
and a little bit messy -LW
 
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 lurking in the Monastery: (7)
As of 2014-04-21 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (489 votes), past polls