sub close_files() #args: none. uses global array: fhandle_array { my $handle; foreach $handle (@fhandle_array) { close $handle; } }