Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by zwon (Abbot)
on Dec 31, 2012 at 10:39 UTC ( #1011041=note: print w/replies, xml ) Need Help??


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

It depends on what do you mean by filehandle is in fact STDOUT. E.g. consider the following:

$ perl -E'open my $foo, "<&=1"; say $foo->fileno; say $foo == \*STDOUT + ? "STDOUT" : "Not STDOUT"' 1 Not STDOUT

Replies are listed 'Best First'.
Re^2: check if a filehandle is STDOUT when using use strict;
by ISAI student (Scribe) on Dec 31, 2012 at 10:49 UTC
    I can assume that it gets assigned the value of \*STDOUT I.E. $file= \*STDOUT ;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011041]
help
Chatterbox?
[karlgoethebier]: Listen and compare
[shmem]: karlgoethebier: es ist theologisch umstritten, ob jesus an christi himmelfahrt tatsächlich besoffen und mit bollerwagen zu seinem vater aufgebrochen ist
[karlgoethebier]: shmem: Ja ischweis
[karlgoethebier]: shmem: Vielleicht hat er in den Bollerwagen gebrochen?

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-05-25 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?