in reply to Usage of STDIN for file reading inside a module
The code in the module is reading everything from STDIN, that's why there's nothing left for the main code to read. There are two issues with the design: normally, modules don't have code that executes when you load them except initialization for the module itself, and second, a module normally wouldn't access STDIN. More commonly, the module would contain a sub that the main code can call and that would take a filehandle as an argument. If you think you need the design as you showed it, then I suspect an XY Problem and it'd be better if you explained what it is you're trying to do.
P.S. Please use <code> tags to format your code.
|
|---|