use foo; my $d = foo->getdata; print "foo's data - ", <$d>; print "main's data - ", ; __DATA__ this data is in main