#!/usr/bin/perl -w use strict;my$data="4a75737420416e6f74686572205065726c204861636b6572"; +my$l=length$data;my$str="";for(my$x=0;$x<$l;$x+=2){$str=substr($data, +$x,2); print(chr(hex$str));}print"\n";

TStanley
In the end, there can be only one!

Replies are listed 'Best First'.
Tips
by beowulf (Scribe) on Mar 23, 2001 at 04:45 UTC
    Don't use strict in a piece of obfuscated code. You might comment that it passes use strict, but you shouldn't use it.
    Don't use multiple letter names.
    Use comma operators.
    Use alternate forms of the for loop.
    Don't use as many parenthesis.
    Try harder next time, it's absurdly easy to figure out how it works.

    Life? What's a life?

      Thanks for the advice, and I will definitely try harder next time :-)

      TStanley
      In the end, there can be only one!
Re: Variation on a theme..
by satchboost (Scribe) on Mar 24, 2001 at 01:24 UTC
    To be more obfuscated (and to get the carriage return in), why not try:
    $d="4a75737420416e6f74686572205065726c204861636b65720a";while($d){($b,$d)=($d=~/(.{2})(.*)/g);print(chr(hex$b));} While doing a japh within "use strict;" AND "-w" is impressive, it's also cool to work less characters (and less spacing). Also, instead of the for-loop using the length of $d, I thought it might be neater to use a while-loop controlled by a diminishing $d.