we wroted a perl code to fetch some information we
want from a web site. The code is as below:
#!/usr/bin/perl
use LWP::Simple; use HTML::Parse; use HTML::FormatText; use CGI; $query = new CGI; my ($html, $ascii); $html = get("http://www.tcmb.gov.tr/kurlar/today.html"); defined $html or die "Sayfa gelmiyor bi turlu!!"; $ascii = HTML::FormatText->new->format(parse_html($html)); @satircik=split /\n/,$ascii; $dolaralis=substr($satircik[11], 30,11); $dolarsatis=substr($satircik[11], 40,11); $markalis=substr($satircik[17], 30,11); $marksatis=substr($satircik[17], 40,11); $frankalis=substr($satircik[18], 30,11); $franksatis=substr($satircik[18], 40,11); $euroalis=substr($satircik[30], 30,11); $eurosatis=substr($satircik[30], 40,11); $sterlinalis=substr($satircik[31], 30,11); $sterlinsatis=substr($satircik[31], 40,11); $output = '<?xml version="1.0" encoding="ISO-8859-9" ?>'; $output .= "\n<doviz>\n"; $output .= "<dolar>\n"; $output .= " <alis>$dolaralis</alis>\n"; $output .= " <satis>$dolarsatis</satis>\n"; $output .= " </dolar>\n"; $output .= " <mark>\n"; $output .= " <alis>$markalis</alis>\n"; $output .=" <satis>$marksatis</satis>\n"; $output .=" </mark>\n"; $output .=" <frank>\n"; $output .=" <alis>$frankalis</alis>\n"; $output .=" <satis>$franksatis</satis>\n"; $output .=" </frank>\n"; $output .=" <sterlin>\n"; $output .=" <alis>$sterlinalis</alis>\n"; $output .=" <satis>$sterlinsatis</satis>\n"; $output .=" </sterlin>\n"; $output .=" <euro>\n"; $output .=" <alis>$euroalis</alis>\n"; $output .=" <satis>$euroalis</satis>\n"; $output .=" </euro>\n"; $output .="</doviz>\n"; $outputfile="doviz.xml"; open (dovizhtml, ">$outputfile"); print dovizhtml $output; print $query->redirect('doviz.xml'); We have the debug error:
Can't locate HTML/Parse.pm in @INC(@INC
contains:
/usr/lib/perl5/5.6.0/i386-linux /usr/lib/................................................................... ....................) at /usr/local/plesk/apache/vhosts/loop10.com/httpdocs/DDdeneme/parite2.cgi line 3 Begin Failed-compilation aborted at /usr/local/plesk/apache/vhosts/loop10.com/httpdocs/DDdeneme/parite2.cgi line 3 " Although we have the modules, why perl gives that
error?!!?
thanks
funky
Istanbul
|
- Re: module errors GsuLinuX
- Re: module errors Brett W. McCoy