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";