Subject: | Bug in Net::UCP 0.41 |
Date: | Fri, 5 Nov 2010 13:37:26 +0100 |
To: | "'bug-Net-UCP [...] rt.cpan.org'" <bug-Net-UCP [...] rt.cpan.org> |
From: | Filip Chodounsky <Filip.Chodounsky [...] simac.cz> |
Hi all,
I've encountered a bug in Net::UCP 0.41.
The construction of the variable $string in the function _make_5x()
starting on line 1326 of UCP.pm should not use the hash functions "exists"
e.g.
(exists $arg->{adc} ? $arg->{adc} : '')
...
but the functions "defined"
e.g.
(defined $arg->{adc} ? $arg->{adc} : '') ...
since if the value of e.g. "exists $arg->{adc}" is true then the value of $arg->{adc}
may be undefined and should not be used to construct the string $string.
The substitution of "exists" by "defined" when testing hash values should probably
be done in more places than the above mentioned one.
I have not verified the replacment of other occurrences of "exists" function ;-(
The other issue was the discrepancy between the documentation and implementation of send_sms() function.
The parameter SENDER_TEXT is not inherited from the new() constructor.
I've made a quick hack and substituted the original line 137
SENDER_TEXT => '',
with
SENDER_TEXT => $self->{SENDER_TEXT},
to make the inheritance work.
Otherwise thanks for a great module !
Best Regards
Filip