in reply to Turning text umop-apisdn

Why are you using tr/// to change a single quote to a single quote -- twice? Why split and join the line? Why not just:
for ( reverse <> ) { chomp; ( my $line = reverse lc ) =~ tr/ahbbmfnnjpdrvutwqgye/eyqgwtuvrdpjn +nfmbbha/; print "$line\n"; }

Replies are listed 'Best First'.
Re^2: Turning text umop-apisdn
by dewey (Pilgrim) on Mar 27, 2007 at 14:45 UTC
    Thanks for the clean-up. I didn't have a good understanding of all the different things reverse can do (in particular, the
    for ( reverse <> ) {
    usage is new to me). Splitting and joining... oh, that was left-over from when I thought I needed to split up the string in order to reverse it (again, I just don't know what reverse does, I'd better hit perldoc) and I just spaced on getting rid of those steps.
    Not sure that you mean by using tr/// twice...
    ~dewey

      He means that you do not need to quote the arguments to tr:

      tr/ahbbmfnnjpdrvutwqgye/eyqgwtuvrdpjnnfmbbha/

      Good Day,
          Dean

        Ah, I see. Right, thanks.
        ~dewey