Description | The error:
Use of uninitialized value in string ne at /usr/local/pf/sbin/pfsetvlan line
999 (0000001)
(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 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.
the code:
if ( (@locationlog)
&& ( scalar(@locationlog) > 0 )
&& ( $locationlog[0]->{'mac'} ne '' ) )
{
if ($switch->isMacInAddressTableAtIfIndex(
$mac, $switch_port
)
)
{
When locationlog has a NULL mac, the two first conditions are true but the mac field of $locationlog[0] is undef. The warning is about comparing undef with other stuff.
Why does locationlog contains a NULL mac? Is it useful? I noticed that if $mac is undef in locationlog_insert_start then it will insert a NULL value for the mac. So its kind of supported..
I need to talk with Regis about that bug. Could this be the crasher we are looking for in some of our clients? |