I am using the chordname() function and would like it to return a warning
and undef, instead of die "Bad note $note!" Having a module just give up
and die in the middle of processing is painful for programs trying to use
the module. This makes the programmer have to eval the code and either
parse STDERR or just check $@. It might be smoother to use an if-then-
else that warn()s and have the subroutine return undef. I have submitted
a tiny patch, that passes your distribution test and is attached to this
ticket.
Thanks in advance!
Gene Boggs <gene@cpan.org>
Software Engineer-at-large
Subject: | Music-Chord-Namer-diff.txt |
56,65c56
<
< # my $flag = 0;
< # foreach my $note(@notes){
< # unless(defined $notevalues{$note}){
< # $flag++;
< # warn "Bad note \"$note\"!";
< # }
< # }
< # return undef if $flag;
<
---
>
67a59
> die "Bad note \"$note\"!" unless defined $notevalues{$note};