sub write_array_1{ my $file = shift; my $r_array = \@_; open FILE, ">$file" or die "failed to open $file ($!)"; print FILE @$r_array; close FILE; }