Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by mhearse (Chaplain)
on Jan 01, 2013 at 17:58 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found