Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Lowering my STDards :)

by hossman (Prior)
on Jun 29, 2007 at 20:55 UTC ( [id://624148]=note: print w/replies, xml ) Need Help??


in reply to Lowering my STDards :)

Why do I have to do all that selecting of file handles? If STDOUT is already selected by default, and I'm not changing to another handle, can't I just use...

Yes, presuming you know beyond a shadow of a doubt that STDOUT is already selected. The code you quoted takes care of the possibility that STDOUT is not the currently selected handle, but that you want to to autoflush STDOUT regardless of which handle is currently selected

But if theres a flush(STDOUT) function, I haven't seen it documented

Functions that take Handles as arguments tend to be very perl4esque, and not many have been added in a while. There is a more OO mechanism for dealing with handles in the IO::Handle class, which includes an flush method...

my $io = IO::Handle->new_from_fd(fileno(STDOUT),"w")) ... $io->print(...); ... $io->flush(); ...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-16 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found