title: Why does my Perl server fail to bind to port 80?
body: <p>I copied the following script and run it to have it listen on port 80. But <code>netstat</code> doesn't show port 80.  Why does <code>netstat</code> not sow it, or the Perl script is not correct?</p>
  
  <pre><code>#!/usr/bin/perl -w
  use Socket;
  use IO::Handle; 
  
  $port=80; 
  $host='localhost'; 
  $packhost=inet_aton($host); 
  $address=sockaddr_in($port,$packhost); 
  
  socket(SERVER,AF_INET,SOCK_STREAM,getprotobyname('tcp')); 
  bind(SERVER,$address); 
  listen(SERVER,10); 
  
  while( 1 ) {
      next unless (accept(CLIENT,SERVER)); 
      CLIENT-&gt;autoflush(1); 
      $msg_out="WHAT DO YOU WANT?\n"; 
      send(CLIENT,$msg_out,0); 
      close CLIENT;
  } 
  
  close SERVER; 
  exit 1;
  </code></pre>