Subject: | Warning due to not setting version value |
Date: | Tue, 23 Jan 2018 23:04:01 -0500 |
To: | <bug-Convert-BinHex [...] rt.cpan.org> |
From: | Daniel Macks <dmacks [...] netspace.org> |
During the self-test of Convert-BinHex-1.125 on OS X 10.13 (Apple's perl-5.18.2):
t/bin_to_hex_file.t ....... Use of uninitialized value in pack at /sw/build.build/convert-binhex-pm-1.125-2/Convert-BinHex-1.125/blib/lib/Convert/BinHex.pm line 939.
I get a similar warning using the binhex.pl script. Line 939 is packing $self->version but the bin_to_hex_file.t never sets that value in the object, so the accessor method returns an undef. That method should have a fallback mode of returning a zero if not explicitly set. For sanity, it should also return zero if the object's value is non-numeric (or should throw an error if a caller tries to set it to a non-numeric value).
dan
--
Daniel Macks
dmacks@netspace.org