in reply to Revisionism, Perl-Style

I have no idea what this does (it doesn't do anything on my system) but for those interested, here's what it comes out as.
s/ / \n/xi, s/ \n/lave/, s/lave/join 'abe', chop $_, chop $_, chop $_, chop $_;/eimx, s/abe/();/eg, s/p? \n\n/eval $_;/exes;

Replies are listed 'Best First'.
Re: Re: Revisionism, Perl-Style
by MeowChow (Vicar) on Feb 03, 2001 at 01:47 UTC
    Close, but no cigar :P

    Remember, newlines within substitutions/matches that are modified by /x are ignored. Take out your '\n's and the de-obfuscated code "does the right thing", namely the last substitution finds a match, evaluates the substitution expression, which is an eval instruction which in turn evaluates the string "eval", contained by that time in $_, which leads to endless recursion.

       MeowChow                                               
                    print $/='"',(`$^X\144oc $^X\146aq1`)[-2]
      Looks like spaz has uncovered a bug in B::Deparse.
      % perl -le 'print "a" =~ /a' -e '/x' 1 % perl -MO=Deparse -le 'print "a" =~ /a' -e '/x' -e syntax OK print 'a' =~ /a\n/x; % perl -le 'print "a" =~ /a\n/x' %
      Oops!

      (I'm taking advantage of the implicit newline for -e.)

        Good catch. AFAIK, B::Deparse is frought with bugs, as it is... I can rarely get it to deparse anything but the simplest Perl.
           MeowChow                                               
                        print $/='"',(`$^X\144oc $^X\146aq1`)[-2]