#!/usr/bin/perl close STDERR; open AA, ">/tmp/myfd2" or die $!; # gets fd 2 open STDERR, ">/tmp/myfd3" or die $!; # gets fd 3 warn "Hello";