sub openOut { my $filename = shift; open my $fh, '>', $filename or die $!; select $fh; return $fh; };