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.
|
|---|