I have a shell script which contains some functions in it. One of those functions has to be executed through perl. The perl functions checks whether port is opened on a remote server or not.
#!/usr/bin/ksh
function1
function2
telnet_check()
{
#!/usr/bin/perl -w
use IO::Socket;
use IO::Socket::INET;
my ($host,$port);
$host=Ip address ;
$port=9443;
my $sock=IO::Socket::INET->new("Ip address:$port") or die "" ;
}
some shell commands
while executing the above script, am getting the error
syntax error at line: `(' unexpected [which falls in the line my ($host,$port); under the Perl function]
Could any one help what can be done to fix the above error.
Cheers in Advance :)