I think the closest you can get is using a tied filehandle. This would nicely get you around all the problems like print not being overridable, etc. See this node for a simple example.
In reply to Re: Mocking files for reading
by almut
in thread Mocking files for reading
by mayaTheCat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |