Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: check if a filehandle is STDOUT when using use strict;

by mhearse (Hermit)
on Jan 01, 2013 at 17:58 UTC ( #1011171=note: print w/ replies, xml ) Need Help??


in reply to check if a filehandle is STDOUT when using use strict;

#!/usr/bin/env perl use strict; print "PID: " . $$, "\n"; open STDOUT, ">/tmp/returntozork" or die $!; while (1) { sleep 10; }
PID: 3868 shell> ls -l /proc/3868/fd/ lrwx------. 64 Jan 1 09:55 2 -> /dev/pts/0 l-wx------. 64 Jan 1 09:55 1 -> /tmp/returntozork lrwx------. 64 Jan 1 09:55 0 -> /dev/pts/0


Comment on Re: check if a filehandle is STDOUT when using use strict;
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-12-27 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls