in reply to Re^2: Searching for two lines that begin with the same string
in thread Searching for two lines that begin with the same string

We used <>, which reads from the files named on the command line, or STDIN if none were specified on the command line. You could read from any other file handles instead just by specifying it.

open(my $data_fh, '<', $data_file_name) or die("Unable to open data file \"$data_file_name\": $!\n"); while (my $line = <$data_fh>) { . . .

You should replace the word "data" with something more descriptive, at least in the error message.