in reply to Re: Matching or masking specific characters in an array of strings
in thread Matching or masking specific characters in an array of strings

You are going to get one extra hyphen because

print ( $common_letters[ $_ ] || "-" ) for ( 0 .. length $reference );

should be

print ( $common_letters[ $_ ] || "-" ) for ( 0 .. length( $reference ) + - 1 );

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^3: Matching or masking specific characters in an array of strings
by pat_mc (Pilgrim) on Dec 25, 2008 at 22:13 UTC
    Thanks for pointing this out, johngg!

    You are, of course, perfectly right ... I apologise for overlooking this detail. As regards the overall approach of my code, however, I am glad to report that this correction changes nothing.