GrabWeather Error

Hi,

If I invoke GrabWeather I get the following error:

Use of uninitialized value in concatenation (.) or string at
/usr/local/bin/GrabWeather line 200.

Line 200 reads:

print TmpFile "$SkyConditions\n";

before that there are lines referring to sky condition:

-----------
my ($StationInfo, $UpdateTime, $SkyConditions, $CodedMETAR);

while (<TmpFile>)
{
chop;

if ($Flag == 0) { $StationInfo = $_; };
if ($Flag == 1) { $UpdateTime = $_; };
if (/^Sky conditions:/)
{
$SkyConditions = $_;
$SkyConditions =~ s/Sky conditions: (.*)/$1/;
}

------------

Does anyone know how to fix this?

In the meantime I just uncommended line 200.

GrabWeather works just the same.

Thanks & regards
--
Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
heisspf [ Do, 13 Juli 2006 05:08 ] [ ID #1389603 ]

Re: GrabWeather Error

Peter -- Since the error is from an unitialized variable, the obvious
thing to try is to initialize it with a harmless default value. Add a
line something like this one:

> my ($StationInfo, $UpdateTime, $SkyConditions, $CodedMETAR);

$SkyConditions = " " ;

> while (<TmpFile>)

I'm assuming this is Perl code; it looks like Perl.

Peter wrote:
> Hi,
>
> If I invoke GrabWeather I get the following error:
>
> Use of uninitialized value in concatenation (.) or string at
> /usr/local/bin/GrabWeather line 200.
>
> Line 200 reads:
>
> print TmpFile "$SkyConditions\n";
>
> before that there are lines referring to sky condition:
>
> -----------
> my ($StationInfo, $UpdateTime, $SkyConditions, $CodedMETAR);
>
> while (<TmpFile>)
> {
> chop;
>
> if ($Flag == 0) { $StationInfo = $_; };
> if ($Flag == 1) { $UpdateTime = $_; };
> if (/^Sky conditions:/)
> {
> $SkyConditions = $_;
> $SkyConditions =~ s/Sky conditions: (.*)/$1/;
> }
>
> ------------
>
> Does anyone know how to fix this?
>
> In the meantime I just uncommended line 200.
>
> GrabWeather works just the same.
>
> Thanks & regards

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Ray Olszewski [ Do, 13 Juli 2006 08:31 ] [ ID #1389605 ]

Re: GrabWeather Error

ray [at] comarre.com said:
> Add a line something like this one:
> > my ($StationInfo, $UpdateTime, $SkyConditions, $CodedMETAR);

> $SkyConditions = " " ;

Thanks! That did it.
--
Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
heisspf [ Fr, 14 Juli 2006 06:11 ] [ ID #1391011 ]
Linux » gmane.linux.newbie » GrabWeather Error

Vorheriges Thema: Adding Custom Applications to Damn CD Linux
Nächstes Thema: automatic service start at startup