OSDN Git Service

remove require, Time::Simple
authorlonginus <longinus@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 10 Aug 2012 00:11:05 +0000 (00:11 +0000)
committerlonginus <longinus@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 10 Aug 2012 00:11:05 +0000 (00:11 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@947 4e526526-5e11-4fc0-8910-f8fd03428081

rectool/trunk/rectool.pl

index 184170d..95a3dec 100755 (executable)
@@ -28,10 +28,10 @@ use Sort::Naturally;
 use SVG;
 use Time::Piece;
 use Time::Seconds;
-use Time::Simple;
 use Time::HiRes;
 use Tie::IxHash;
-use XML::Atom;
+use XML::Atom::Feed;
+use XML::Atom::Entry;
 use XML::Generator::DBI;
 use XML::SAX::Writer;
 #%DB::packages = ( 'main' => 1 );
@@ -460,7 +460,6 @@ if ( $mode eq 'graph' ) {
        {
                print "Content-Type: image/svg+xml\n\n";
 
-               require SVG;
                $date = Date::Simple->new( split /-/, $date );
                $graph_bgn = $date->format('%Y-%m-%d');
                $graph_end = $date->next->format('%Y-%m-%d');
@@ -502,9 +501,8 @@ if ( $mode eq 'graph' ) {
                        $svg->rectangle( 'x' => 50, 'y' => $_ * 20 + 14, width => $width, height => 2 );
                }
                if ( $today ) {
-                       require Time::Simple;
-                       my $time = Time::Simple->new();
-                       my $x = ( $time->hours * 60 + $time->minutes ) * 0.5 + 50;
+                       my $time = Time::Piece->localtime;
+                       my $x = ( $time->hour * 60 + $time->minute ) * 0.5 + 50;
                        $svg->tag( 'line', x1 => $x, x2 => $x, y1 => 30, y2 => $tuner{all} * 20 + 20, 
                                style => { stroke => 'red', 'fill-opacity' => '1.0' } );
                }
@@ -634,9 +632,6 @@ if ( $mode eq 'graph' ) {
 ################ mode=atom ################
 
 if ( $mode eq 'atom' ) {
-       require XML::Atom::Feed;
-       require XML::Atom::Entry;
-
        my $recording_count = $encoding_count = $jbk_count = 0;
        my $ary_ref = $dbh->selectall_arrayref(
                "SELECT chtxt, title, btime, etime, opt 
@@ -1725,8 +1720,6 @@ if ( $mode eq 'recognize' ) {
 ################ mode=expert ################
 
 if ( $mode eq 'expert' ) {
-       require List::Compare;
-
        my $ary_ref;
 
        $HTML =~ s/%HTML_TITLE_OPT%/ - Expert/;
@@ -1955,7 +1948,6 @@ if ( $mode eq 'test' ) {
        $HTML =~ s|%REFRESH%|<meta http-equiv="refresh" content="300">|;
        $HTML .= qq {<div>\n};
 
-       require Data::Dumper::Concise;
        $tmp = read_file( '/etc/rec10.conf' );
        $tmp =~ s/\n/<br>\n/gs;
        $HTML .= $tmp;
@@ -2281,8 +2273,6 @@ sub check_error {
 }
 
 sub get_overlap {
-       require List::Util;
-
        my $ary_ref = $dbh->selectall_arrayref(
                "SELECT btime, etime, title
                FROM timeline