There is a script for pearl need your help

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. 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.

help me please

  • what is the question? Please specify by editing the text using the "button" edit . - aleksandr barakin
  • Fails when executing the script Bareword found where operator expected at ./sms.pl line 19, near "" | gnokii --sendsms +79467383638 ”) || die "Starting" (Missing operator before Starting?) ............. - Andrei

1 answer 1

The interpreter quite specifically refers to the "garbage" in this place:

 "| gnokii --sendsms +79467383638» 

a line of text must be marked with the same type of quotation marks, not different ones:

 "| gnokii --sendsms +79467383638" 
  • Thank you so much - Andrei