Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
No such thing as a small change
 
PerlMonks  

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

by zwon (Monsignor)
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


Comment on Re: check if a filehandle is STDOUT when using use strict;
Download Code
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (15)
As of 2014-04-18 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls