Snaky snake. Not that obfuscated but i like the form of the code and how it works. Comments/suggestions are of course welcome. Only thing i couldn't get around is the fact you got to save it to your harddrive to get it working. (else it will just print "Snake")

Update: It's quite a bit shorter now.
#!/usr/bin/perl -w use strict; open+0; ($_ =join "", <0> )=~ s/\S/x/g; print"Snake\n$_"


$§=lc(sub{}^" \6 \n");$§=~s/\(.*\)//;for(split
('',$§)){$/=$_;for(5..7){$/++}$:.=$/}print$:;1

Replies are listed 'Best First'.
Re: Snake
by chipmunk (Parson) on Sep 07, 2001 at 01:49 UTC
    One clever way to open the source file is open 0; you then read the source code with <0>. This works because, when you pass open a single argument, it serves as the filehandle and the name of the scalar variable holding the filename. So, open 0 opens filehandle 0 on the file named in $0.
      Hmmm... very nice. Didn't know about that yet. Thanks for pointing it out. :)

      $§=lc(sub{}^" \6 \n");$§=~s/\(.*\)//;for(split
      ('',$§)){$/=$_;for(5..7){$/++}$:.=$/}print$:;1
Re: Snake
by Hofmator (Curate) on Sep 06, 2001 at 20:57 UTC

    If you find a way around using that nasty open FOO,"<$0";
    That's not too difficult, just use the DATA filehandle:
    #!/usr/bin/perl seek DATA, 0, 0; undef $/; print <DATA>; __DATA__
    But I don't know if you can still make a nice snake with that ...

    -- Hofmator

      Thank you very much. :) I'll sure use it in future.

      $§=lc(sub{}^" \6 \n");$§=~s/\(.*\)//;for(split
      ('',$§)){$/=$_;for(5..7){$/++}$:.=$/}print$:;1