try this one.
use Net::IRC;
$irc = new Net::IRC;
$conn = $irc->newconn(Nick => 'John',
Server => 'server name or IP address',
Port => 8080,
Username => 'John_Lamb',
Ircname => 'Hi John',
SSL =>1
);
$irc->start;
if ($conn==1)
{
print "John is online";
}
else
{
print "Not online";
}