I apologise if this is too simple, it is my first JAPH. I do not quite consider myself a perl hacker yet, but I was playing around with my regular expressions and figured I would ty my luck :). I was mostly excited that it work, and that it works with warnings and "use strict."

I did notice something interesting, though. I had to escape the dot in the second regex for it to work. Would this be becuase it thought I was trying to cat or is it a modifier that I have not been introduced to?

I would also like to say that it looks like a much better block of code when it does not wrap.
my $japh="Wx.hi.fg.gh.!No.ab.bc.gh.uv.rs.ef.!Cd.rs.ef.yz.!Uv.no.pq.xy. +rs.e"; $japh=~s/!/ /g; $japh=~s/\./\b/g; $japh=~tr/a-mn-zA-MN-Z/n-za-mN- +ZA-M/; print $japh, + "\n";

Replies are listed 'Best First'.
Re: CloneArmyCommander Tries His Luck at JAPH
by Anonymous Monk on Jan 14, 2005 at 01:00 UTC
    You had to escape the dot because in a regex, "." means "any character except newline" (it includes newline to, depending on your regex modifiers). Unescaped, s/./\b/g replaces every character with a backspace (\b) character.
      Thanks :). I had never tried to match a period before, so it totally threw me off guard when I got a warning, and esaping it was an accident that happened to make the code interpret :).
Re: CloneArmyCommander Tries His Luck at JAPH
by ambrus (Abbot) on Jan 14, 2005 at 08:56 UTC

    I am always surprised how much rot13'ed text you can find on the net if you google on any rot13'ed word.

      Most of it is probably thanks to a that little UNIX utility we all know and love :) (I say this knowing, of coarse, rot13 was around looooooooooooooong before UNIX, but who could live without a nice copy of rot13 on their computer :).

      Also, crey rot13 googled brings some bizarre Perl results :).
Re: CloneArmyCommander Tries His Luck at JAPH
by amrangaye (Friar) on Jan 24, 2005 at 15:21 UTC

    ++ CloneArmyCommander :-) That had me there for a bit, cause I didn't understand what you were doing replacing each '.' with a word boundary (\b). Then I realised it was actually a backspace.I'm assuming this means (correct me if I'm wrong) in the 'match part' of the s/// operator, a '\b' matches a word boundary; but in the 'replace part' it replaces with a backspace. At least this was the case when I tested with perl -ple "s/\b/./g" Am I going in the right direction, anyone?

      I was asking myself how I could possibly add more useless code to make it look bigger, so I took the letters in "Just Another Perl Hacker," I just made into "JKuvsttu. . ." using the letter that comes after, seperated every two letters with "." and I replaced the dot with a backspace which also gets rid of the extra character after each letter :). I like to play around with the escape sequences to see what kinds of results I can get from them :). I just happened to be playing with the backspace that day :).

      Thanks for the complement :). I would have replied earlier, but I have not had much internet time to come in and actually write since college started back.