Switch Storable to IO::File from FileHandle, only load if needed
authorDavid Leadbeater <dgl@dgl.cx>
Tue, 8 Mar 2011 21:49:54 +0000 (21:49 +0000)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 12 Mar 2011 20:53:26 +0000 (12:53 -0800)
On blead IO::File would be autoloaded but can't rely on this as
Storable is dual life.

dist/Storable/Storable.pm

index 8d57ab3..44b85db 100644 (file)
@@ -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': $!";