From e79cf535c0536d407107d2356706114a05049bc0 Mon Sep 17 00:00:00 2001 From: Adam Kennedy Date: Sun, 30 Apr 2006 01:15:46 +0000 Subject: [PATCH] Making isSeekable more debug-friendly --- lib/Archive/Zip.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/Archive/Zip.pm b/lib/Archive/Zip.pm index 1188754..6f14749 100644 --- a/lib/Archive/Zip.pm +++ b/lib/Archive/Zip.pm @@ -311,18 +311,20 @@ sub _binmode # Archive::Zip sub _isSeekable # Archive::Zip { my $fh = shift; - - if ( UNIVERSAL::isa( $fh, 'IO::Scalar' ) ) { + if ( UNIVERSAL::isa($fh, 'IO::Scalar') ) { return 0; - } elsif ( UNIVERSAL::isa( $fh, 'IO::String' ) ) { + } + if ( UNIVERSAL::isa($fh, 'IO::String') ) { return 1; - } elsif ( UNIVERSAL::isa( $fh, 'IO::Seekable' ) ) { + } + if ( UNIVERSAL::isa($fh, 'IO::Seekable') ) { return 1; - } elsif ( UNIVERSAL::can( $fh, 'stat' ) ) { + } + if ( UNIVERSAL::can($fh, 'stat') ) { return -f $fh; } return ( - UNIVERSAL::can( $fh, 'seek' ) and UNIVERSAL::can( $fh, 'tell') + UNIVERSAL::can($fh, 'seek') and UNIVERSAL::can($fh, 'tell') ) ? 1 : 0; } -- 2.11.4.GIT