syntax error: `(' unexpected in shell script : <p>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.</p>

<pre><code>#!/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-&gt;new("Ip address:$port") or die "" ;

}

some shell commands
</code></pre>

<p>while executing the above script, am getting the error </p>

<pre><code> syntax error at line: `(' unexpected [which falls in the line my ($host,$port); under the Perl function]
</code></pre>

<p>Could any one help what can be done to fix the above error.</p>

<p>Cheers in Advance :)</p>
