in reply to Print Current Program Source Code

use strict; use warnings; seek DATA, 0, 0; print while <DATA>; __DATA__

Prints:

use strict; use warnings; seek DATA, 0, 0; print while <DATA>; __DATA__

Update Note that you must have either __END__ or __DATA__ at the end of the script (you may have data following that if you wish - it will be printed too).


DWIM is Perl's answer to Gödel