Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: autoflush STDOUT 1 does not need import?

by shmem (Chancellor)
on Sep 14, 2015 at 14:23 UTC ( [id://1141935]=note: print w/replies, xml ) Need Help??


in reply to [solved] autoflush STDOUT 1 does not need import?

When a method which cannot be resolved is invoked on a file handle, perl loads modules from the IO namespace to resolve it. The notation autoflush STDOUT 1 is equivalent to STDOUT->autoflush(1), which triggers the loading of IO::Handle:

qwurx [shmem] ~> perl -e 'use strict; use warnings; print$_.$/ for sor +t keys %INC; autoflush STDOUT 1' strict.pm warnings.pm qwurx [shmem] ~> perl -e 'use strict; use warnings; STDOUT->autoflush( +1); print$_.$/ for sort keys %INC' Carp.pm Exporter.pm Fcntl.pm IO.pm IO/File.pm IO/Handle.pm IO/Seekable.pm SelectSaver.pm Symbol.pm XSLoader.pm strict.pm warnings.pm

This is documented in Method Call Variations in perlobj.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found