diff options
author | David Golden <dagolden@cpan.org> | 2010-11-28 23:12:12 -0500 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2010-11-29 15:30:50 -0500 |
commit | 15e6cdd91beb4cefae4b65e855d68cf64766965d (patch) | |
tree | 9b22cf13e30a346c10c6dce7d2531d9e002e9d62 /hints | |
parent | a812f6a926c0966af8d2a9a3d2d05fe1a5df510f (diff) | |
download | perl-15e6cdd91beb4cefae4b65e855d68cf64766965d.tar.gz |
Filehandle method calls load IO::File on demand
When a method call on a filehandle would die because the method can not
be resolved and L<IO::File> has not been loaded, Perl now loads IO::File
via C<require> and attempts method resolution again:
open my $fh, ">", $file;
$fh->binmode(":raw"); # loads IO::File and succeeds
This also works for globs like STDOUT, STDERR and STDIN:
STDOUT->autoflush(1);
Because this on-demand load only happens if method resolution fails, the
legacy approach of manually loading an IO::File parent class for partial
method support still works as expected:
use IO::Handle;
open my $fh, ">", $file;
$fh->autoflush(1); # IO::File not loaded
Diffstat (limited to 'hints')
0 files changed, 0 insertions, 0 deletions