in reply to Overhead of __DATA__?

There is less overhead than storing data in a separate file. No seek necessary because the filehandle is already at the right position after the script compilation. Also, if your data section is very long and never explicitely accessed using the DATA handle, it will never be loaded from the disk (except the beginning by normal read-ahead of the OS).

In fact if you "rewind" it by seek( DATA, 0, 0) than do print <DATA> you do print the whole script:

seek( DATA, 0, 0); print <DATA>; __DATA__ this is no quine but downright cheating

note to refute a remark on the CB

To my own surprise: you can pipe this script to Perl and you will get the same result as executing it from a file because of the IO buffering. Indeed, the perl seek() does not translate on a seek() system call. So, if buffering permits, you can perl-seek a non seekable stream!!!

quine page

-- stefp