open my $rm3d_fh, '>', $fullFileName or die "...$!"; rm3dHeader( $rm3d_fh ); sub rm3dHeader { my $fh = shift; print $fh "START..."; }