Re: [Nmap-scanner-general] Nmap::Scanner XML.pm change
Brought to you by:
perldork
From: Max <nm...@we...> - 2004-02-27 17:33:07
|
Will, Thanks for the patch! You are using .7alpha now, yes? You found a valid fix, but a better one I think is to set the PORT_COUNT element to 0 in sub new { } .. that is what I have done. $self->{PORT_COUNT} = 0; This I feel is a preferred solution because having the > 0 test is clearer logic (in my opinion) than just (value) .. does that make sense? Feel free to argue if you disagree :). perl 5.8.x is more picky about uninitialized values than 5.6.x was .. so there may be others of these to clean up. What I did with the model classes was set all class attributes to reasonable default values that would evaluate as 'false but defined.' Please let me know if you find other places where this is the case .. I will hold off on the official .7 release for another week and do some checking into this myself .. in XML.pm I have several hash elements that are initialized to undef, but only because they are object references so setting them to 0 or "" obscures (in my opinion) the intent of the variables. Good find, Will! Thank you for reporting this and for your patch. Anyone else still seeing warnings about uninitialized values. Viktor, how are things working for you now that you are using version .7 .. or are you using that version? Are you still having problems or are your scripts working properly now? Regards, Max On Fri, 27 Feb 2004 11:20:28 EST, "Will Saxon" wrote: > Hello, > > I use this module to perform regular scans of our network using perl 5.6.1 on > FreeBSD (currently 5.2.1-RELEASE). Every time the scans run I get output lik > e: > > Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_per > l/5.6.1/Nmap/Scanner/Backend/XML.pm line 157. > > I have 'fixed' this, but I don't know if what I did will cause things to work > incorrectly. I think anything greater than zero counts as 'true' for Perl so > it ought to work ok. Here is my patch: |