Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I got this idea from playing with gmax's camelfilter code.
Actually, I decided to post the code with which I created my original idea. My original ascii art obfuscation is nifty in and of itself. However. this way everyone gets the two-for-one deal. (roll your own!) Also, I figured that no one would have their code view set that wide (106) so I wanted something narrower (this) to print it.
So here you go, turn any code snippet into instant obfu/ascii-art!
If a pattern file is not specified it attempts to read itself as the model.
If you wish to use the shark art remove the usage and shebang (passing Getopt and strict on the command line).
The very least you will want to do is pass it a file containing some perl (with -c).
It worked on everything I ran it against however, I am sure that in some cases tweaking of the input code will be required.
Besides itself and the XTYPE obfu (now posted bellow), one of my favorite tests was a DNA strand using theorbtwo's dnareader. Worked out of the box! A link to an ascii art generator can be found at crazyinsomniac's homenode.
And yes, sharky printed itself.
I was about to post the plain code but thought it would be nicer if it generated itself.
...plus I needed an excuse for naming it sharky. ;^)
Enjoy.    -xtype

Update: I did away with creating a "pattern" variable (ie. S7F12:.. as per camelfilter.pl), and instead read the pattern file and create the output all in the same loop. Making it a lot shorter and faster. Although it no longer has a default "pattern" it will attempt to read itself if opt_p is undefined. I posted the original Obfuscated ASCII-art code (that sharky.pl used to print by default) in reply, since that was the reason for me noding this.
Perhaps this should be in Craft now that the obfuscation has been removed from it? -oh well.

In reply to sharky.pl - info by xtype
in thread sharky.pl by xtype

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (1)
    As of 2020-12-05 15:32 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      How often do you use taint mode?





      Results (64 votes). Check out past polls.

      Notices?