()=/(.*)/s,$_=reverse,print $1 for @_=( " tsuJ"," rehtonA"," lreP","\nresubA");
(Update: thanks, LD2)

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Thanks to Rudif
by LD2 (Curate) on Mar 03, 2001 at 23:23 UTC
    only change .. reverse the u and s..

    to be.. "tsuJ".. unless you mean it to be Jsut. :)
Re: Thanks to Rudif
by Kickstart (Pilgrim) on Mar 04, 2001 at 07:52 UTC
    It doesn't really count as obfuscation if you can just read it, I think. :)

    On the other hand:

    print "Just Another Perl Hacker!";

    Kickstart

      Does it count as obfuscation if you can't explain how it works? Explain to me how my code works, please.

      japhy -- Perl and Regex Hacker
        I scratched my head over this for a while. Very clever. Here's my attempt at explaining the key parts.

        ()=/(.*)/s,

        $_ is an alias for one of the reversed strings in @_. Assuming this is being run by Perl 5, list context forces $1 to get set in the absence of /g. (perlre notes that $1 wouldn't get set in Perl 4.) $1 now refers to the entire string held in $_ (including the "\n" in the final one, thanks to /s).
        $_=reverse,
        Use scalar context to set $_ to a reversed copy of itself.
        print $1
        Since $1 still refers to the entirety of $_, the reversed string is printed. (You could just print $_ here, but that would hardly be obfuscating.)
        for @_=(" tsuJ", ...)
        @_ is a false clue. It could as well be @x. The array assignment makes a copy of the array. This permits individual elements (pointed to by $_) to be reversed. Without the array assignment here, reverse would fail in an attempt to reverse a read-only string.
        My comment was just a joke (hence the smiley face). Not sure why someone decided to give me a negative score on it.

        Kickstart