Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by blokhead (Monsignor)
on May 05, 2005 at 03:43 UTC ( #454234=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package NoPrint;
    use Symbol;
    ...
    sub PRINT { return undef }
    sub PRINTF { return undef }
    sub WRITE { return undef }
    
  2. or download this
    my $old_fh = select NoPrint->new;
    
    ...
    
    ## now printing is back to normal again:
    print "foo\n" or warn "print failed (2)";
    
  3. or download this
    {
        local *STDOUT = NoPrint->new;
    ...
    }
    
    print "foo\n" or warn "print failed (2)";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (15)
As of 2014-07-30 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (230 votes), past polls