# 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... #### package Foo; sub import { shift; my($caller) = caller; no strict 'refs'; ${"$caller\::foo"} = shift; } 1; # The main script: use Foo << '_*_'; This is my data over two lines! _*_ print "\$foo = '$foo'\n";