Changeset 191

Show
Ignore:
Timestamp:
11/07/06 02:19:53 (7 years ago)
Author:
lincoln
Message:

CPAN dependency diet

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • shepherd

    r190 r191  
    6464 
    6565use LWP::UserAgent; 
    66 use Sort::Versions; 
    6766use Cwd; 
    6867use Getopt::Long; 
    6968use Data::Dumper; 
    7069use XMLTV; 
    71 use XMLTV::Ask; 
    7270use POSIX qw(strftime mktime); 
    7371use Date::Manip; 
    7472use Algorithm::Diff; 
    7573use List::Compare; 
    76 use Compress::Zlib; 
    7774 
    7875# --------------------------------------------------------------------------- 
  • tv_grab_au

    r190 r191  
    3838 
    3939use LWP::UserAgent; 
    40 use Sort::Versions; 
    4140use Cwd; 
    4241use Getopt::Long; 
    4342use Data::Dumper; 
    44 use XMLTV; 
    4543use XMLTV::Ask; 
    4644use POSIX qw(strftime mktime); 
    47 use Date::Manip; 
    48 use Algorithm::Diff; 
    49 use List::Compare; 
    5045use Compress::Zlib; 
    5146 
     
    393388# ----------------------------------------- 
    394389# 
     390 
     391# versioncmp from Sort::Versions by Kenneth J. Albanowski 
     392sub versioncmp( $$ ) { 
     393    my @A = ($_[0] =~ /([-.]|\d+|[^-.\d]+)/g); 
     394    my @B = ($_[1] =~ /([-.]|\d+|[^-.\d]+)/g); 
     395 
     396    my ($A, $B); 
     397    while (@A and @B) { 
     398        $A = shift @A; 
     399        $B = shift @B; 
     400        if ($A eq '-' and $B eq '-') { 
     401            next; 
     402        } elsif ( $A eq '-' ) { 
     403            return -1; 
     404        } elsif ( $B eq '-') { 
     405            return 1; 
     406        } elsif ($A eq '.' and $B eq '.') { 
     407            next; 
     408        } elsif ( $A eq '.' ) { 
     409            return -1; 
     410        } elsif ( $B eq '.' ) { 
     411            return 1; 
     412        } elsif ($A =~ /^\d+$/ and $B =~ /^\d+$/) { 
     413            if ($A =~ /^0/ || $B =~ /^0/) { 
     414                return $A cmp $B if $A cmp $B; 
     415            } else { 
     416                return $A <=> $B if $A <=> $B; 
     417            } 
     418        } else { 
     419            $A = uc $A; 
     420            $B = uc $B; 
     421            return $A cmp $B if $A cmp $B; 
     422        }        
     423    } 
     424    @A <=> @B; 
     425} 
    395426 
    396427sub query_grabbers