Inspired by a question on beginners@perl.org, here's my response on how to capture the source code for the running program, unless special measures are taken.
my %sources; local *ARGV; local $/; @ARGV = ($0, values %INC); while (<>) { $sources{$ARGV} = $_; }

Replies are listed 'Best First'.
Re: Get the source code for the running application into a hash
by ysth (Canon) on Mar 21, 2005 at 23:47 UTC
    That could be a little dangerous without also doing local $^I;.