Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 wandering the Monastery: (4)
As of 2024-04-25 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found