open(my $fh, '<', $inputs) or die ... while (<$fh>) { ... } close($fh); # Optional.