Tfe

Ongi etorri tfe-ren webgunera...

Old stuff/ecole_etude_fac_de_pau/perl/test.pl

(Deskargatu)
#!/usr/bin/perl -w

use IO::Socket::INET;

($host,$port) = ($ARGV[0],$ARGV[1]); 
  	 
  	  $remote = IO::Socket::INET -> new ( 
  	 
  	          Proto => "tcp", 
  	 
  	          PeerAddr => $host, 
  	 
  	          PeerPort => $port , 
  	 
  	          Timeout => "5" 
  	 
  	          ) or die "Could not open socket to $host:$port.\n"; 
  	 
  	 
  	 
  	 print $remote "GET /\n\n\n"; 
  	 
  	 
  	  @line = <$remote>; 
  	 
  	 
  	  print "$line[1]\n"; 
  	 
#  	  print LOG "$line[1]\n"; 
 	 
  	  close($remote);