open(STDOUT, '>', "dump.out") || die "cannot redirect stdout"; [download]
see perldoc -f open
In reply to Redirecting STDOUT by oha in thread Dumping data by Anonymous Monk