Odud has asked for the wisdom of the Perl Monks concerning the following question:

I'm looking for a module that given a string such as "Lo1" will produce "Upper case letter L, Lower case letter o, figure 1" say. I'm pretty sure that I saw such a thing many years ago but searching CPAN I can't find it. I guess I could extend Lingua::Alphabet::Phonetic but I don't want to reinvent a wheel if there is one already. Apologies if my search of CPAN was insufficient. For the curious I'm trying to come up with a way of communicating machine generated passwords to users - the passwords contain lots of confusable characters e.g. 1lLoO0 etc, but I can't fix that!

Replies are listed 'Best First'.
Re: Say String
by deibyz (Hermit) on Apr 09, 2008 at 15:45 UTC
      Thanks, that looks familiar - can't think why my searching didn't find it.
Re: Say String
by thundergnat (Deacon) on Apr 09, 2008 at 16:54 UTC

    Maybe you are thinking of the charnames pragma?

    #!/usr/bin/perl use warnings; use strict; use charnames(); my $string = 'Lo1'; print string_to_text($string); sub string_to_text{ my @chars; push @chars, charnames::viacode(ord($_)) for split //, $_[0]; return join ', ', @chars; }

    Yields...

    LATIN CAPITAL LETTER L, LATIN SMALL LETTER O, DIGIT ONE
    
      Also looks good - I'll try both and see which will be easier for a non-specialist user to understand.