Subject: | Paths-Graph 0.03 and use strict |
Date: | Sun, 09 Sep 2012 18:18:39 +0200 |
To: | <bug-Paths-Graph [...] rt.cpan.org> |
From: | "Dominik Strnad" <ltow [...] centrum.cz> |
Hi,
I would like to report minor bug in Paths-Graph 0.03.
when used together with use strict you get:
Use of uninitialized value $father in string eq at
/usr/local/share/perl/5.14.2/Paths/Graph.pm line 45 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.
To help you figure out what was undefined, perl will try to tell you the
name of the variable (if any) that was undefined. In some cases it cannot
do this, so it also tells you what operation you used the undefined value
in. Note, however, that perl optimizes your program and the operation
displayed in the warning may not necessarily appear literally in your
program. For example, "that $foo" is usually optimized into "that "
. $foo, and the warning will refer to the concatenation (.) operator,
even though there is no . in your program.
Use of uninitialized value $father in string eq at
/usr/local/share/perl/5.14.2/Paths/Graph.pm line 66 (#1)
This is due to missing check if $father is defined at all.
Request to change all three conditions in original code:
$father = 'zero' if father eq '0'
into:
if ( defined($father) and $father eq '0' ) { $father = 'zero'; }
With regards
Litin