#!/usr/bin/perl use strict; use warnings; open my $fh,'>',"test.txt"; close $fh; my $ret = select $fh; select STDOUT; say "'$ret'";