I took the obfuscated code from the GPF Subliminal Perl T-Shirt and further obfuscated it. I'm not happy with it yet but I'm still working on it. However, I do want feedback so I'm posting here for comments and suggestions.
#!/usr/bin/perl -w
@p=([split //,"mcsio-p.w/:th!a+rv+P+aR!ila++'"],
[split //,"/o.cmcfgww/pt+ydyeeFGde+etuFamI"]);
$l=$#{$p[0]}+$#{$p[1]}+1;
for $i (0..$l){$_.=$i%2?$p[0][int(($i-1)/2)]:$p[1][int($i/2)];}
$_=~s/\+/ /g;
$_=reverse $_;
print;
Or perhaps it should be this (strict compliant now!):
#!/usr/bin/perl -w
use strict;
sub _i($){int(($_[0])/2)}
my @p=([split //,"mcsio-p.w/:th!a+rv+P+aR!ila++'"],
[split //,"/o.cmcfgww/pt+ydyeeFGde+etuFamI"]);
my $l=$#{$p[0]}+$#{$p[1]}+1;
for my $i (0..$l){$_.=$i%2?$p[0][_i($i-1)]:$p[1][_i($i)];}
$_=~s/\+/ /g;
print $_=reverse $_;
Updated: Changed title 2002-05-07 13:29 (GMT -0600)
Updated: Added some code 2002-05-07 14:48 (GMT -0600)
Matthew Musgrove
Who says that programmers can't work in the Marketing Department?
Or is that who says that Marketing people can't program?
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.