From: David Leadbeater Date: Tue, 8 Mar 2011 21:49:54 +0000 (+0000) Subject: Switch Storable to IO::File from FileHandle, only load if needed X-Git-Tag: accepted/trunk/20130322.191538~4990 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed0d1802ce3cc63f60a6de522c13210091d6bc6b;p=platform%2Fupstream%2Fperl.git Switch Storable to IO::File from FileHandle, only load if needed On blead IO::File would be autoloaded but can't rely on this as Storable is dual life. --- diff --git a/dist/Storable/Storable.pm b/dist/Storable/Storable.pm index 8d57ab3..44b85db 100644 --- a/dist/Storable/Storable.pm +++ b/dist/Storable/Storable.pm @@ -19,7 +19,6 @@ package Storable; @ISA = qw(Exporter); file_magic read_magic ); -use FileHandle; use vars qw($canonical $forgive_me $VERSION); $VERSION = '2.27'; @@ -108,8 +107,10 @@ EOM } sub file_magic { + require IO::File; + my $file = shift; - my $fh = new FileHandle; + my $fh = IO::File->new; open($fh, "<". $file) || die "Can't open '$file': $!"; binmode($fh); defined(sysread($fh, my $buf, 32)) || die "Can't read from '$file': $!";