Oi pessoal

Eu estou me esmerando com essa... mais um bug encontrado. Para evitar
problemas estou repassando o fonte de um script que eu fiz e que
realmente funciona (fui pegar o fonte errado, de um arquivo que n�o
era o que eu realmente utilizava... :P )

A� vai:

-------------------------------------------------------------

#!/usr/bin/perl

use IO::Socket;

# Receive arguments

  if ($#ARGV < 1) {
    die "webtext <server> <port> <document>\n"
  } else {
    $server   = $ARGV[0];
    $port     = $ARGV[1];
    $document = $ARGV[2];
  }

# Obtain the file from the remote server

  $remote = IO::Socket::INET->new(Proto=>"tcp",
                                  PeerAddr=>$server,
                                  PeerPort=>$port,
                                  Reuse=>1)
  or die "Can't connect to \"$server\"\n";
  # set buffering off
  $remote->autoflush(1);
  # write HTTP request to server
  print $remote "GET $document HTTP/1.0\n\n";
  # recieve everything the server sends, and print it to the screen
  @page = <$remote>; $page = "@page";
  # Close connection with server
  close $remote;

# Split the header and the page content

  $page =~s/\n\ /\n/g;
  ($header, @content) = split(/\015\012\015\012/, $page);

# Take off all the tags

  $content = "@content";
  (@text) = split(/\</, $content);
  foreach $text (@text) {
    ($tag, $text_content) = split(/\>/, $text);
    push(@output, $text_content);
  }
  $output = "@output";

# Print the remote file without tags

  print $output;

-------------------------------------------------------------

[]'s

Charles Roberto Pilger  ([EMAIL PROTECTED])
Work: http://www.unisinos.br Personal: http://CharlesPilger.i.am
ICQ: 636464  -  WCQ: 14074 (http://www.wcq.com.br)
http://www.mrweb.com.br/perl/
�������������>No site da lista, voce tera tudo sobre PERL,
>>LINUX, PHP, ASP e informacoes, cadastramento
>>e descadastramento da Lista.
������������==

Responder a