perl -lwe 'my $h1=*STDOUT; open(my $h2, ">", "tmp/xx1.txt") or die; $h1 eq *STDOUT && print 1; $h2 eq *STDOUT && print 2' ####