Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Three argument version of open '>-'

by LanX (Saint)
on Mar 01, 2021 at 21:55 UTC ( [id://11128968]=note: print w/replies, xml ) Need Help??


in reply to Three argument version of open '>-' (updated)

same behavior for me

DB<47> open $fh,">-" DB<48> say $fh "bla" bla DB<49> say "bla" bla DB<50> close STDOUT DB<51> say $fh "bla" DB<52>

copy solution

DB<53> say "bla" bla DB<54> $fh=\*STDOUT # copy DB<55> say $fh "bla" bla DB<56> close STDOUT DB<57> say $fh "bla" DB<58>

what am I missing?

EDIT: Both approaches warn under warnings if STDOUT was closed.

UPDATE

I just remembered that the debugger does scary redirections under the hood, so these tests may not be reliable.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-05-21 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found