in reply to Dumping data

open(STDOUT, '>', "dump.out") || die "cannot redirect stdout";
redirects STDOUT to dump.out

see perldoc -f open