ERB quine fun

Quoth Ken Bloom on the ruby-lang mailing list:

If you really want to be evil and twisted, what’s the smallest self-
reproducing erb program you can write that doesn’t read its own file.

And who could ignore a challenge like that on an Easter Sunday? This is the best I could do:

<%=s=">%"}esrever.s{#}tcepsni.s{#=s=%<";";"<%=s=#{s.inspect}#{s.reverse}"%>

77 characters of fun.

Leave a Reply

Entries (RSS)