in reply to Testing methods that read input from files

You could give the filename "<&DATA" to your module, if you wouldn't insist on the 3-arg form of open. That is a design defect in your class. Another way would be
sub load_widgets { my($self,$infh)=@_; # ^ IMPORTANT!!! $infh=new IO::File("<",$infh)unless ref$infh; #sorry open($fh...) needs undef ... }
if you think of preventing magic open by the user.