perl脚本在完成后不会终止

时间:2013-07-22 09:56:02

标签: perl exit execution terminate

我正在使用xinetd为端口调用perl脚本。我观察到有时文件在完成后不会自动终止。我正在粘贴下面文件的代码。

#! /usr/bin/perl -w
use warnings;
use Time::Piece;
use DBI;
use diagnostics;

$ENV{TZ} = 'Asia/Kolkata';

my $today = localtime->strftime();        # Local time zone
my $todaysecs = localtime->epoch();       # Local time in secs(total secs)

my $line = <STDIN>;                        #input from XinetD
$line =~ s/^\s+//;
$line =~ s/\s+$//;

if($line ne "") {
    $connet_db = DBI->connect('dbi:mysql:db_name','db_user','db_password');
    $connet_db->do("insert into `table_name` (`column1` , `column2`, `data_time`) values ('$line', '$today', $todaysecs)");
    $connet_db->disconnect();
}

我也粘贴了cmd的输出,表明某些进程没有终止。

14848 /usr/bin/perl -w /home/abhi       48:34
15225 /usr/bin/perl -w /home/abhi       46:02
15836 /usr/bin/perl -w /home/abhi       43:31
16160 /usr/bin/perl -w /home/abhi       40:56
16777 /usr/bin/perl -w /home/abhi       38:24
16948 /usr/bin/perl -w /home/abhi       37:02
17107 /usr/bin/perl -w /home/abhi       36:37
17269 /usr/bin/perl -w /home/abhi       35:51
17702 /usr/bin/perl -w /home/abhi       33:16
17876 /usr/bin/perl -w /home/abhi       32:00
18270 /usr/bin/perl -w /home/abhi       30:40
18678 /usr/bin/perl -w /home/abhi       28:09

请帮我弄清楚这个问题。

0 个答案:

没有答案
相关问题