- May 11, 2008
- 21,785
- 1,306
- 126
Hi people, i hope somebody can help me because i have zero experience with perl. My boss had a pc that logged weather information for creating comparison charts. Unfortunately, the pc died and putting the hdd in another pc resulted in a unrecoverable crash of windows. So the best as i did, i tried to install all software on another pc. And most of it is up and running again. Except for the perl script. The problem is that the colleague who wrote it all is long gone.
Although this is a linux subsection, it is actually a windows pc running national instruments cvi compiled software and perl scripts. But perl is unix based, i believe.
I have installed ActivePerl-5.22.1.2201-MSWin32-x86-64int-299574.exe
I wonder if i have to correct version because it is a 32 bit windows. It does seem to run and the ppm perl module manager says i have the XML parser and i have looked in the directories, and it is there.
This is the error message i get, see picture :
The perl script.
Does anybody know what i must do to get it to function ?
What have i forgotten ?
Although this is a linux subsection, it is actually a windows pc running national instruments cvi compiled software and perl scripts. But perl is unix based, i believe.
I have installed ActivePerl-5.22.1.2201-MSWin32-x86-64int-299574.exe
I wonder if i have to correct version because it is a 32 bit windows. It does seem to run and the ppm perl module manager says i have the XML parser and i have looked in the directories, and it is there.
This is the error message i get, see picture :

The perl script.
Code:
#c:perlbinperl
# import packages
use XML::RSS;
use LWP::Simple;
use CGI;
# initialize object
$rss = new XML::RSS();
my $fname = "> c:/solar/weatherShiphol.txt";
($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1900; # Misschien wel een "milleniumbug" ingebouwd...
$mon += 1;
# get RSS data
$raw = get('http://.************************.xml'); # Removed the link, personal stuff.
# parse RSS feed
$rss->parse($raw);
# open logfile to write results to...
open filename, $fname or die "Can't find File $fname $!\n";
# loop trough the items available within RSS feed.
foreach my $item (@{$rss->{'items'}})
{
$title = $item->{'title'};
$description = $item->{'description'};
@mijnArray = split(/\|/, $description);
($temperature , $humidity , $pressure , $conditions , $winddir , $windspeed , $Updated ) = @mijnArray;
print filename "[date]\n\"";
printf filename "%02d-%02d-%02d", $mday , $mon , $year;
print filename "\"\n\n";
print filename "[time]\n\"";
printf filename "%02d:%02d:%02d", $hr , $min , $sec;
print filename "\"\n\n";
print filename "[location]\n\"" , $title , "\"\n\n";
print filename "[wind]\n\"" , $winddir , " " , $windspeed, "\"\n\n";
print filename "[sky]\n\"" , $conditions , "\"\n\n";
print filename "[temp]\n\"" , $temperature , "\"\n\n";
print filename "[visibility]\n\"" , "" , "\"\n\n"; #
print filename "[pressure]\n\"" , $pressure , "\"\n\n";
print filename "[humidity]\n\"" , $humidity, "\"\n\n";
}
close filename;
print "Succes!";
Does anybody know what i must do to get it to function ?
What have i forgotten ?
Last edited: