=================================================================== RCS file: /cvs/openbsd/OpenBSDTorrents/lib/BT/MetaInfo/Cached.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- openbsd/OpenBSDTorrents/lib/BT/MetaInfo/Cached.pm 2005/05/05 22:44:03 1.8 +++ openbsd/OpenBSDTorrents/lib/BT/MetaInfo/Cached.pm 2005/05/06 19:30:25 1.9 @@ -1,4 +1,4 @@ -# $Id: Cached.pm,v 1.8 2005/05/05 21:44:03 andrew Exp $ +# $Id: Cached.pm,v 1.9 2005/05/06 18:30:25 andrew Exp $ use strict; package BT::MetaInfo::Cached; @@ -12,13 +12,18 @@ use BT::MetaInfo; use base 'BT::MetaInfo'; -$VERSION = do { my @r = (q$Id: Cached.pm,v 1.8 2005/05/05 21:44:03 andrew Exp $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +$VERSION = do { my @r = (q$Id: Cached.pm,v 1.9 2005/05/06 18:30:25 andrew Exp $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; sub new { my $class = shift; my $file = shift; my $cache_settings = shift; + + if (ref $file eq 'HASH') { + $cache_settings = $file; + $file = undef; + } $cache_settings->{namespace} ||= 'BT::MetaInfo::Cached';