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)";