public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* GrabWeather Error
@ 2006-07-13  3:08 Peter
  2006-07-13  6:31 ` Ray Olszewski
  0 siblings, 1 reply; 3+ messages in thread
From: Peter @ 2006-07-13  3:08 UTC (permalink / raw)
  To: linux-newbie

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@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GrabWeather Error
  2006-07-13  3:08 GrabWeather Error Peter
@ 2006-07-13  6:31 ` Ray Olszewski
  2006-07-14  4:11   ` Peter
  0 siblings, 1 reply; 3+ messages in thread
From: Ray Olszewski @ 2006-07-13  6:31 UTC (permalink / raw)
  To: linux-newbie

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@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GrabWeather Error
  2006-07-13  6:31 ` Ray Olszewski
@ 2006-07-14  4:11   ` Peter
  0 siblings, 0 replies; 3+ messages in thread
From: Peter @ 2006-07-14  4:11 UTC (permalink / raw)
  To: Ray Olszewski; +Cc: linux-newbie


ray@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@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-14  4:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-13  3:08 GrabWeather Error Peter
2006-07-13  6:31 ` Ray Olszewski
2006-07-14  4:11   ` Peter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox