Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 exploiting the Monastery: (8)
As of 2024-05-28 08:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found