Sto avendo dei problemi con un IRC bot che sto scrivendo grazie all'aiuto di guide e di un altro bot. Ho aggiunto la funzione time():
Quando su IRC digito !time, non esce nulla in output, sul terminale esce questo errore:
Non capisco perchè la riga 86 ha problemi..:dodgy:
Codice:
if($rcv =~ /!time/) {
@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
@weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime();
$year = 1900 + $yearOffset;
$theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year";
print sock "PRIVMSG $chan : $theTime\r\t"; #riga 86!!!
}
Quando su IRC digito !time, non esce nulla in output, sul terminale esce questo errore:
print() on unopened filehandle sock at edo.pl line 86, <GEN0> line 80.
Non capisco perchè la riga 86 ha problemi..:dodgy: