in reply to Problem Reading __DATA__ in a Module

I'll assume there is more to test.pl and Module.pm, since you had to instantiate $app somehow)... In test.pl, $fh refers to (most likely) $main::fh, but in Module.pm, it probably refers to $Module::fh (assuming you have a package Module at the top). These are very much different variables.

The million dollar question is, why are you using globals to pass data into a method? Either the filehandle should be an attribute encapsulated in the object, or something passed in explicitly to the method call. Or it could even be a static package variable, with access through a class method.

If you really really really really want to "pass" data to your method this way, just call the variable by its fully-qualified name $Module::fh from test.pl.

Update: Looking even more closely, you should have $fh = \*DATA (note the backslash). Although my previous suggestions still apply as well.

blokhead