in reply to $_[0] as a filehandle

Other posters have answered why it doesn't work. But if you want to make it work:
use FileHandle; sub in { $_[0]->getline } sub out { $_[0]->print(@_[1..$#_]) } out \*STDOUT, in \*STDIN;
--Dave.