Skip Menu |

This queue is for tickets about the Text-Morse CPAN distribution.

Report information
The Basics
Id: 20580
Status: resolved
Estimated: 5 min
Worked: 5 min
Priority: 0/
Queue: Text-Morse

People
Owner: bennie [...] cpan.org
Requestors: kevin.walters [...] morganstanley.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.01
Fixed in: 0.02



Subject: Text-Morse-0.01 - Decode("-----") fails due to 0 and bug relating to lack of defined()
Date: Thu, 20 Jul 2006 13:53:55 +0100
To: bug-Text-Morse [...] rt.cpan.org
From: Kevin J Walters <kevin.walters [...] morganstanley.com>
Hi, diff shows the trivial fix, btw, is there a morse code for the underscore (_) character? prompt$ diff -c Morse-orig.pm Morse.pm *** Morse-orig.pm Fri Jul 20 04:42:34 2001 --- Morse.pm Thu Jul 20 12:36:27 2006 *************** *** 103,109 **** my ($self, @codes) = @_; my @words = @codes; my $dec = $self->{'dec'}; ! my $sub = sub { $_ = $dec->{shift()}; $_ ? $_ : "<scrambled>"; }; foreach (@words) { s/([\.-]+)\s*/&$sub($1)/ge; } --- 103,111 ---- my ($self, @codes) = @_; my @words = @codes; my $dec = $self->{'dec'}; ! # my $sub = sub { $_ = $dec->{shift()}; $_ ? $_ : "<scrambled>"; }; ! ### BUG BUG BUG - original was not using defined() do decode of ----- fails (it's 0) ! my $sub = sub { $_ = $dec->{shift()}; defined($_) ? $_ : "<scrambled>"; }; foreach (@words) { s/([\.-]+)\s*/&$sub($1)/ge; } regards |<evin -- Kevin J Walters Morgan Stanley kevin.walters@morganstanley.com 20 Cabot Square Tel: 020 7425 7886 Canary Wharf Fax: 020 7677 8504 London E14 4QW
I'm taking over the module. (Text::Morse) Thank you for your bug report and patch. I'm sorry it took 8 years for it to be applied! That has to be a record.