in reply to New Obfuscation Trick!

Doesn't work for me as is. Are you sure you don't mean
$J=q$JAPH$;print"${J}s rule";
?

Dingus


Enter any 47-digit prime number to continue.

Replies are listed 'Best First'.
(z) Re^2: New Obfuscation Trick!
by zigdon (Deacon) on Nov 26, 2002 at 17:34 UTC
    It does work for me, in both forms:
    perl -le ' J}s rule' JAPHs rule perl -le ' $J=q$JAPH$;print"${J}s rule"; ' JAPHs rule
    But I don't understand the first version. Why does it work? perl 5.8.0 on linux, btw.

    -- Dan

      Something to do with the lexer I believe, or so I've read.
      HTH

      _________
      broquaint

        Seems related to unicode handling. The relevant entry would be ${^ENCODING} in perlvar. This entry also says: see encoding for details but their is no other occurence of that word in perlvar. Probably it means "see encoding in perluniintro". Gotta read that doc.

        -- stefp -- check out Nemo

Re: Re: New Obfuscation Trick!
by dingus (Friar) on Nov 27, 2002 at 09:12 UTC
    Ok I see why I thought it didn't work. I habitually test fragments like this in an eval statement because I have my own home rolled "Interpreted Perl Console"©. In the interpreted console it fails. If I make a trivial perl script it works.

    Can anyone explain why it doesn't work in an eval and does work as a program?

    #!perl #this script doesn't work my $t = <<'EOT' ; $J=q$JAPH$;print"${"; J}s rule EOT print "$t\nResult:\n"; eval $t; ------------------------------ #!perl #this script works $J=q$JAPH$;print"${"; J}s rule

    Dingus


    Enter any 47-digit prime number to continue.