Skip Menu |

This queue is for tickets about the Music-Chord-Namer CPAN distribution.

Report information
The Basics
Id: 53751
Status: open
Priority: 0/
Queue: Music-Chord-Namer

People
Owner: Nobody in particular
Requestors: gene [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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};
Subject: backward diff
Whoops. My diff was backward but you get the idea. :) -gb Epistemologist-at-large
I guess this is ignore-ware. :(