0

Есть скрипт на перл нужна ваше помощи

root@raspberrypi:/home/pi# cat sms.pl

#!/usr/bin/perl -w use strict; use IO::Socket;

my($server, $newmsg,

$max_len, $server_port);
$max_len = 160;
$server_port = 12345;

$server = IO::Socket::INET->new(LocalPort=>$server_port, Broadcast=>0,
Proto=>"udp")
or die "Error starting UDP Server on port $server_port: $@\n";
print "UDP Server started on port $server_port\n";
$newmsg = "";
while($server->recv($newmsg,$max_len)){
if($newmsg){
#my($port, $ipaddr) = sockaddr_in($server->peername);
print "Received: $newmsg \n";
open(GNOKII, "| gnokii --sendsms +79467383638») || die "Starting gnokii     failed: $!\n";
print GNOKII $newmsg;
close(GNOKII);
}
}

die "recv: $!";

root@raspberrypi:/home/pi# ./sms.pl Bareword found where operator expected at ./sms.pl line 19, near ""| gnokii --sendsms +79467383638») || die "Starting" (Missing operator before Starting?) Backslash found where operator expected at ./sms.pl line 19, near "$!\" (Missing operator before \?) String found where operator expected at ./sms.pl line 25, near "die "" (Might be a runaway multi-line "" string starting on line 19) (Missing semicolon on previous line?) String found where operator expected at ./sms.pl line 25, at end of line (Missing semicolon on previous line?) syntax error at ./sms.pl line 19, near ""| gnokii --sendsms +79467383638») || die "Starting gnokii " Can't find string terminator '"' anywhere before EOF at ./sms.pl line 25.

Помогите пожалуйста

2
  • в чём заключается вопрос? уточните, пожалуйста, отредактировав текст с помощью «кнопки» править. 10 окт 2015 в 16:43
  • Выдает ошыбку при исполнение скрипта Bareword found where operator expected at ./sms.pl line 19, near ""| gnokii --sendsms +79467383638») || die "Starting" (Missing operator before Starting?).............
    – Andrei
    10 окт 2015 в 18:31

1 ответ 1

2

интерперетатор вполне конкретно указывает на «мусор» в этом месте:

"| gnokii --sendsms +79467383638»

строка текста ведь должна быть выделена одним типом кавычек, а не разными:

"| gnokii --sendsms +79467383638"
1
  • Спасибо вам огромное
    – Andrei
    11 окт 2015 в 9:34

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.