in reply to Re: searching for strings
in thread searching for strings

the -- decrement operator is not magical for non-digits.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^3: searching for strings
by shoness (Friar) on Aug 07, 2007 at 09:06 UTC
    Sorry! How strange of Perl to be asymmetric! Why is "--" not as magical as "++"? This will work instead...
    $char_up =~ tr/A-Z0-9/B-ZZ1-99/; $char_down =~ tr/A-Z0-9/AA-Y00-8/;
      cauz if so it wouldn't be symmetric :)

      suppose you have "A00", if you -- you'll get "99" and then if you ++ you'll get "100"

      Oha