Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Divert STDOUT temporarily

by jwkrahn (Abbot)
on Apr 27, 2020 at 19:05 UTC ( [id://11116133]=note: print w/replies, xml ) Need Help??


in reply to Re: Divert STDOUT temporarily
in thread Divert STDOUT temporarily

do { local *STDOUT; open STDOUT, '>', '/dev/null' or die; print "two\n +"; };

You don't need a do{} block when just a bare block will do:

{ local *STDOUT; open STDOUT, '>', '/dev/null' or die; print "two\n"; +}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2025-06-18 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.