[Omaha.pm] Substitution loop

Jay Hannah jay at jays.net
Tue Jul 31 21:12:27 PDT 2007


On Jul 31, 2007, at 7:29 PM, Jay Hannah wrote:
> Model::OTA::CommonShare::_update_start(/home/jhannah/src/Omni/MVC/ 
> Model/OTA/CommonShare.pm:65):
> 65:       $d1=~s/[^\d]//g;
>
>      DB<11> x $d1
> 0  '2007-08-11'
>
>      DB<12> p $d1
> 2007-08-11
>
>      DB<13> c
> Malformed UTF-8 character (overflow at 0xc9237b89, byte 0x95, after  
> start byte 0xff) in substitution (s///) at /home/jhannah/src/Omni/ 
> MVC/Model/OTA/CommonShare.pm line 65.
> ...stack trace here...
> Malformed UTF-8 character (unexpected continuation byte 0x95, with  
> no preceding start byte) in substitution iterator at /usr/lib/ 
> perl5/5.8.7/Carp/Heavy.pm line 61.
> Malformed UTF-8 character (unexpected non-continuation byte 0x12, 1  
> byte after start byte 0xe0, expected 3 bytes) in substitution  
> iterator at /usr/lib/perl5/5.8.7/Carp/Heavy.pm line 61.
> Substitution loop at /usr/lib/perl5/5.8.7/Carp/Heavy.pm line 61.
> ...snip!...

Well, I have no idea why UTF-8 is involved at all, let alone  
malformed UTF-8.

Adding this line sidesteps the error:
    utf8::downgrade($d1);

As does changing line 65 to:
    $d1 =~ s/\D+//g;

I don't understand, but have spent too much time on this already.  
Time to move back to battles I know how to fight.  :)

j




More information about the Omaha-pm mailing list