getpart: better handle case of file not found

This commit is contained in:
Dan Fandrich 2023-03-28 21:07:06 -07:00
parent 88f1b70546
commit 07ab5bdd3b

View File

@ -325,11 +325,12 @@ sub loadarray {
my ($filename)=@_;
my @array;
open(my $temp, "<", "$filename");
while(<$temp>) {
push @array, $_;
if (open(my $temp, "<", "$filename")) {
while(<$temp>) {
push @array, $_;
}
close($temp);
}
close($temp);
return @array;
}