Some of you may have seen this before; I first published it a few years ago.
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=( $!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++; $_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++ ;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`
(alas, it doesn't work on Windows, just on *nix systems)

Replies are listed 'Best First'.
Re: Nothin' but punctuation
by holli (Abbot) on May 29, 2009 at 09:24 UTC
    This is so f#cking super double ++ good =) It made my day.


    holli

    When you're up to your ass in alligators, it's difficult to remember that your original purpose was to drain the swamp.
Re: Nothin' but punctuation
by tweetiepooh (Hermit) on Jun 02, 2009 at 15:54 UTC
    Truly ++.

    I do however get the following as output on Perl 5.10 on Solaris/SPARC.

    $# is no longer supported at -e line 1. $* is no longer supported at -e line 1. Just another Perl hacker.

      Rats! Well, here's a slightly modified form that doesn't give those warnings:

      `$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,${^^},$~,$@,$:,@% +)=( $!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$",),$=++;$.++;$.++ +;$_ ++;$_++;($_,$\,$,) = ($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,${^^});$, +++; $,++;;$^|=$";`$_${\}$,$/$:$;$~$@$%[$?]$.$~$@${^^}$%[$?]$;$\$"$^$~$@.>& +$=`

      (apologies for the ugly wrapping)

Re: Nothin' but punctuation
by John M. Dlugosz (Monsignor) on Jun 01, 2009 at 20:21 UTC
    Care to explain how it works, roughly? For example what does the `$=` do on a *nix system, and what good is it if the result isn't being used in the code?

      Assuming you don't have a program named "60" (<grin>), it populates $! with a known error message, “No such file or directory”. Later, the line

      $!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/

      fetches some characters from that string. It then mangles and glues those characters together into a shell command, which is executed in the last ¾ of the fourth line.

      Hope this helps....

        I think it gets the text of not existing file "60" and processes is further. Try to run it in a different locale :-) The last statement will not become `echo Just another Perl hacker.`

      It sets $? to -1 (any non-Windows system), and $! to ENOENT (any non-Windows system). ENOENT is 2/"No such file or directory" on linux. I don't know if the program relies on this.

      ...unless, of course, you have a program named 60.