<br clear="all">Olá não consigo entender porque não funciona com CGI meu script:<br><br>#!/usr/bin/perl<br><br>BEGIN {<br> my $homedir = ( getpwuid($>) )[7];<br> my @user_include;<br> foreach my $path (@INC) {<br>
if ( -d $homedir . '/perl' . $path ) {<br> push @user_include, $homedir . '/perl' . $path;<br> }<br> }<br> unshift @INC, @user_include;<br>}<br><br><br>use strict;<br>use warnings;<br>
<br>use CGI qw/:standard/;<br>use Template;<br>use Net::Traceroute;<br>$| = 1;<br><br># some useful options (see below for full list)<br>my $config = {<br>INTERPOLATE => 1, # expand "$var" in plain text<br>
INCLUDE_PATH => '/home/smartcam/public_html/cgi-bin/', # or list ref<br>POST_CHOMP => 1, # cleanup whitespace <br>PRE_PROCESS => '<a href="http://header.info">header.info</a>',# prefix each template<br>
EVAL_PERL=> 1, # evaluate Perl code blocks<br>};<br><br># create Template object<br>my $template = Template->new($config);<br><br><br># specify input filename, or file handle, text reference, etc.<br>my $input = '<a href="http://tracert.tt">tracert.tt</a>';<br>
<br># process input template, substituting variables<br>$template->process($input) || die $template->error();<br><br>print start_form,<br>"Informe o endereço: ",textfield('tracert'),p,<br>submit,<br>
end_form,<br>hr,"\n";<br><br>if ( param() ) {<br>my $host = param('tracert');<br>my $tr = Net::Traceroute->new(host=> "$host");<br> if($tr->found) {<br> my $hops = $tr->hops;<br>
for ( my $i = 0;$i <= 10;$i++ ) {<br> if($hops > 1) {<br> print p( "Tracert: " .<br> $tr->hop_query_host($tr->hops - $i, 0) );<br> }<br> }<br>}<br>}<br>
print end_html();<br>-- <br>Procuro emprego C.V:<br><a href="http://danielmantovani.awardspace.com/">http://danielmantovani.awardspace.com/</a><br><br>print "\x54\x68\x65\x20\x53\x69\x6c\x65\x6e\x74\x20\x47\x75\x61\x72\x64\x69\x61\x6e",$/<br>
<br>