in reply to Re: Line by line parsing from one file, comparing line by line to another file
in thread Line by line parsing from one file, comparing line by line to another file
my $names_file = "code.txt"; open(NAMES, $names_file || die "Could not open file!");
Because of the high precedence of the || operator die will never be called because $names_file is always true.
You need to either use parentheses in the proper place:
open(NAMES, $names_file) || die "Could not open file!";
Or use the lower precedence or operator:
open NAMES, $names_file or die "Could not open file!";
|
|---|