parser - perl - parser
skiv 27.02.2008 12:33
1. Имеется парсерный скрипт: callparser.p3
@main[]
^try{
$res[^file::exec[../../cgi-bin/callparser.cgi]]
^if($res.status){
$result[STATUS: $res.status, STDERR: $res.stderr]
}{
$result[RESULT: $res.text]
}
}{
$exception.handled(1)
$result[Не удалось запустить перловый скрипт: $exception.comment]
}
2. Имеется перловый скрипт: callparser.cgi
#!/usr/bin/perl
use strict;
sleep 3;
my $status = system("parser3");
print "status = $status\n";
3. пишу руками ./callparser.cgi и получаю:
parser3: file not specified
Parser/3.2.2 (compiled on i686-pc-linux-gnu)
Copyright(c) 2001-2007 ArtLebedev Group (
http://www.artlebedev.com)
Author: Alexandr Petrosian <paf@design.ru> (
http://paf.design.ru)
Usage: parser3 [options] file
Options are:
-f config_file Use this config file (/path/to/auto.p)
-h Display usage information (this message)
status = 5632
здесь все ок.
4. захожу на страницу
http://www.v31.dr/callparser.p3 браузером и начинается кашмар.. со скоростью 1 штука в 3 секунды плодятся процессы:
nobody 7170 0.0 0.2 3244 1316 ? S 09:12 0:00 /usr/bin/perl /usr/local/www/v31/htdocs/../../cgi-bin/callparser.cgi
чтобы прекратить это безобразие - комментирую вызов system в перловом скрипте. в браузер выводится:
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 693
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 607
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 521
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 435
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 349
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 263
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 177
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 92
RESULT: content-type: text/html; charset=WINDOWS-1251
content-length: 8
RESULT: status = 0
status = 0
status = 0
status = 0
status = 0
status = 0
status = 0
status = 0
status = 0
помогите пожалуйста понять - что происходит?
- parser - perl - parser, skiv 27.02.2008 12:33