in reply to Are there corner cases I am missing
if($mystring){ dosumpton(split(/\./, $mystring)); } elsif (not defined $mystring){ dosumpton("nogames"); } else { # Something went wrong and we should be notified about it }
The way in which these two forms differ is the question of trailing false but defined values - zeros ('0') and empty strings (''). Your clobber tailing falses with undefs could be reproduced by swapping line 2 above with:
my @args = split /\./, $mystring; pop @args while (@args and !$args[-1]); dosumpton(@args);
Finally, in a very literal sense, your existing branching fails to handle the case where the parent string is defined but major is false - for example, if your version number were 0.11. That will fall right through your block.
|
|---|