summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorDavid Leadbeater <dgl@dgl.cx>2011-03-08 21:49:54 +0000
committerFather Chrysostomos <sprout@cpan.org>2011-03-12 12:53:26 -0800
commited0d1802ce3cc63f60a6de522c13210091d6bc6b (patch)
tree9a56a67eac2d398867357f467c3b6ac803b9af65 /dist
parent1541ec63cc0fc67dec1359c36eb41355ba46aef2 (diff)
downloadperl-ed0d1802ce3cc63f60a6de522c13210091d6bc6b.tar.gz
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.
Diffstat (limited to 'dist')
-rw-r--r--dist/Storable/Storable.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/dist/Storable/Storable.pm b/dist/Storable/Storable.pm
index 8d57ab3bae..44b85db2e4 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': $!";