martes, 14 de diciembre de 2010

WEB CHAT PERL ---

Este es un programa para interactuar con el, aveces nos sentimos solos y no tenemops con quien platicar buenos este programa les puede ayudar ..... solo necesita unos ajustes :)

#!/usr/bin/perl -w
##################################
#
# peque~o servidor de pruebas ...
#
##################################

use IO::Socket;

$port=12000;
my $file="index.html";

$server=IO::Socket::INET->new(
Proto=>"tcp",LocalPort=>$port,Listen=>5,
Reuse =>10
) or die "$!\n";
print "Chat whitme by sekaiknox!\n";
print "listening on $port\n";
while ($client=$server->accept()){
print $client "=========================================\n";
print $client "WELLCOME TO THE HELL\n";
print $client "my name is yooooooooni\n";
print $client "=========================================\n";
my $wtf_counter=1;
print $client "user>";
while(<$client>){
    print ">>> recivo : ";
    print;

        if(/wtf!/i && $wtf_counter eq 1) {
        print "[+] enviando quete pasa?\n";
        print $client "yoooooni> que te pasa ?\n";
    }
   
        if(/wtf!/i && $wtf_counter eq 2) {
        print "[+] enviando hey hey que te pasa ?\n";
        print $client "yoooooni> hey hey que te pasa ?\n";
    }
        if(/wtf!/i && $wtf_counter  eq 3){
            print "[+] enviando mira negro no me faltes al respeto?\n";
            print $client "mira negro no me faltes al respeto?\n";
            }
        if(/wtf!/i && $wtf_counter eq 4){
            print "[+] enviando listo negro me artastes con tus grocerias me voy.\n";
            print $client "listo negro me artastes con tus grocerias me voy.\n";
            salir($client);
            }       

    if(/hola/i) {
        print "[+] enviando hola que tal?\n";
        print $client "hola que tal?\n";
        }
    if(/que/i && /es/i){
        print "[+] enviando mmm nose ...\n";
        print $client "mmm nose ...\n";
         }
    if(/guapo/i ) {
        print "[+] enviando es un mounstrito\n";
        print $client "es un mounstrito\n";
        }
    if(/y/i){
        print "[+] enviando tambien ...\n";
        print $client "tambien ...\n";

        }
    if(/salir/i){
        print "terminando..\n";
        print $client "adios ...\n";
        exit ;
        }
$wtf_counter++;
print $client "user>";
}


}
sub salir($client) {
print $client "===========================================\n";
exit;
}
suaves con el codigo ....

No hay comentarios: