Couldn't figure out how to get the #! to work, but it's not really necessary. Uses the open 0 trick, so save it to a file before running

use strict ;my@f; use warnings ; open 0;$/= \11;my $i= 0; while ( <0>){chop; push@{$f [ $i]},$_;$i =($i+1)%3} close 0;$~ ="it"; my( $l,$m,$r)= map{$f[$_] }(0 .. 2); for(0..$#{ $l}){$m->[ $_]||= ''; $r-> [$_ ] ||=''; #$l }){ $m ->[ format it= @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< $l-> [$_], $m-> [$_], $r-> [$_], . write;}

print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))

Replies are listed 'Best First'.
Re: Format quine (slightly obfu)
by pmonk4ever (Friar) on Dec 03, 2009 at 18:08 UTC
    bv,

    Ok, the output I get in Windoze Perl 5.10.0 is that the file prints. Is that correct?

    I'd think not, based on the format it= line. I have just begun to peruse these delightful nodes and can get some of them to run ok here at $work, but it's clear that I'll have to run some of these @ $home to get the full effect!

    Thanks for the fun code!

    pmonk4ever

    "No trees were harmed in the creation of this node. However, a rather large number of electrons were somewhat inconvenienced."

      Thank you! You're correct in that it prints out itself. It's not strictly a true quine, since it reads in its own file, but fun nonetheless. Read on for a breakdown of how it works:

      Hope that helps!


      @_=qw; Just another Perl hacker,; ;$_=q=print "@_"= and eval;