# The module: package Foo; sub get { my($caller) = caller; no strict 'refs'; local $/; scalar readline "$caller\::DATA"; } 1; # The main script: use Foo; print Foo->get; __DATA__ Whatever you want...