Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: searching for strings

by CountZero (Bishop)
on Aug 06, 2007 at 15:21 UTC ( [id://630838]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://630838]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found