Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
After reading this node, I dusted off one of my oldest perl scripts. If you can't tell, I had just discovered regular expressions.

That last paragraph haxorfied:
4f73r r34d1n9 }{4c|<1n9, 1 du$73d 0ff 0n3 0f my 01d357 p3r1 5cr1p7z.

You can see, it goes really overboard, but I have actually seen people talk like this. Ahh, the joys of USENET.

#!/usr/bin/perl srand; sub ran { return $_[( rand (scalar @_ ))] } # Allow random choices while (<>) { $data = $_; # The conversion rules. # Watch the order if you decide to add your own. # Use the e regex switch and the "ran" function with a list of possibi +lities # to pick a random possibility. #Phrase conversions $data =~ s/(\btoo\b|\bto\b)\b/2/gi; $data =~ s/\belite\b/ran("eleet","leet")/gie; $data =~ s/\bdude/d00d/gi; $data =~ s/\bfile/phyle/gi; $data =~ s/\byou\b\b/ran("u","you","u","u")/gie; # Make "u" way more +probable $data =~ s/\bcool\b/ran("kool","kewl")/gie; $data =~ s/\bhacker/haxor/gi; #Single character conversions $data =~ s/ss^\b/ran("55","\$\$","\$\$")/gie; $data =~ s/s\b/ran("z","\$", "z")/gie; #s -word boundary to z $data =~ s/e/3/gi; $data =~ s/t/7/gi; $data =~ s/(l|i)/1/gi; $data =~ s/a/4/gi; $data =~ s/s/ran("5","\$","\$","\$")/gie; $data =~ s/b/8/gi; $data =~ s/g/9/gi; $data =~ s/o/0/gi; $data =~ s/n/ran("\/\\\/","n","n")/gie; #Huh? Convert n to /\/ $data =~ s/h/ran("h","\}\{")/gie; # h to }{ $data =~ s/k/ran("k","\|\<")/gie; $data =~ s/w/\\\/\\\//gi; # w to \/\/ print $data; }

In reply to 1 0\/\/Nz U DoodZ! by IndyZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found