package Foo::Bar::Quux; print "now in runtime...\n"; BEGIN { (my $package = __PACKAGE__) =~ s!::!/!g; my $file = $INC{$package.'.pm'}; open DATA , '<', $file or die "Can't open '$file': $!\n"; my $data = 0; while () { /^__DATA__$/ and $data = 1 and next; next unless $data; print "DATA: $_"; }; } 1; __DATA__ foo bar quux now in runtime... now in main #### qwurx [shmem] ~ > perl -e 'print "now in main\n"; use Foo::Bar::Quux' DATA: foo DATA: bar DATA: quux now in runtime...