Guest zip2002 Postado Novembro 30, 2004 Denunciar Share Postado Novembro 30, 2004 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/&/&/g;$file =~ s/\t/ /g;$file =~ s/<(\/)?([\-:a-z0-9]+)(.*?)>/<span style={color:#0000FF}><<span style={color:#FF0000}>$1<\/span><span style={color:#800000}>$2<\/span><span style={color:#FF0000}>$3<\/span>><\/span>/gsi;$file =~ s/<\?(.+?)>/<span style={color:#008040}><?$1><\/span>/gsi;$file =~ s/<\!(.+?)\]>/<span style={color:#408040}><\!$1\]><\/span>/gsi;$file =~ s/<\!(.+?)\>/<span style={color:#808040}><\!$1><\/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>"; Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 [ GuTo ] Postado Janeiro 7, 2005 Denunciar Share Postado Janeiro 7, 2005 Hey!How are you man?Where are you from?What's your name? I'm learning english and I'm training now It's cool!I Don't know CGI/Perl, but I'm pushing a subject.hauahuahaua.Hold's Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 dark0 Postado Janeiro 7, 2005 Denunciar Share Postado Janeiro 7, 2005 man, what problem your code have?Can you write here what error u're getting?Cya Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Guest zip2002
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/&/&/g;
$file =~ s/\t/ /g;
$file =~ s/<(\/)?([\-:a-z0-9]+)(.*?)>/<span style={color:#0000FF}><<span style={color:#FF0000}>$1<\/span><span style={color:#800000}>$2<\/span><span style={color:#FF0000}>$3<\/span>><\/span>/gsi;
$file =~ s/<\?(.+?)>/<span style={color:#008040}><?$1><\/span>/gsi;
$file =~ s/<\!(.+?)\]>/<span style={color:#408040}><\!$1\]><\/span>/gsi;
$file =~ s/<\!(.+?)\>/<span style={color:#808040}><\!$1><\/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
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.