use IO::Handle; my $sm = IO::Handle->new; open ($sm, ...