use IO::Handle; my $fh = IO::Handle->new; tie *$fh, ...;