Ir para conteúdo
Fórum Script Brasil
  • 0

Can Anyone Help Me With This Script


Guest zip2002

Pergunta

I'm leaning perl...but cant see whats the purpose of this script. can anyone help me??

thanx in advance

#!/usr/bin/perl

use strict;

use LWP::Simple;

use CGI;

my $cgi = new CGI;

my $url = $cgi->param('url');

my $text = $cgi->param('text');

print $cgi->header(-type => $cgi->param('html') ? 'text/html' : 'text/xml');

my $file = $url ? get $url : $text;

unless (length $file){

print "<pre>ERRO</pre>";

exit;

}

$file =~ s/&/&amp;/g;

$file =~ s/\t/ /g;

$file =~ s/<(\/)?([\-:a-z0-9]+)(.*?)>/<span style={color:#0000FF}>&lt;<span style={color:#FF0000}>$1<\/span><span style={color:#800000}>$2<\/span><span style={color:#FF0000}>$3<\/span>&gt;<\/span>/gsi;

$file =~ s/<\?(.+?)>/<span style={color:#008040}>&lt;?$1&gt;<\/span>/gsi;

$file =~ s/<\!(.+?)\]>/<span style={color:#408040}>&lt;\!$1\]&gt;<\/span>/gsi;

$file =~ s/<\!(.+?)\>/<span style={color:#808040}>&lt;\!$1&gt;<\/span>/gsi;

$file =~ s/"(.*?)"/<span style="color:blue">"<span style="color:#330066">$1<\/span>"<\/span>/gsi;

$file =~ s/style={(.+?)}/style="$1"/gsi;

print "<pre style=\"color:black;background:white;margin-top:0px;margin-bottom:0px\">$file</pre>";

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Hey!

How are you man?

Where are you from?

What's your name? biggrin.gif

I'm learning english and I'm training now wink.gif

It's cool!

I Don't know CGI/Perl, but I'm pushing a subject.

hauahuahaua.

Hold's

Link para o comentário
Compartilhar em outros sites

  • 0

man, what problem your code have?

Can you write here what error u're getting?

Cya

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...