in reply to Re^6: text matching
in thread text matching

That's good to hear!

$/ is the input record separator and is essentially used to specify what character should be used to delimit lines. The default input record separator is \n (a.k.a. the newline character).

However, in the context that you have it, $/ = undef; tells perl that there is no input value separator so that the entire line gets read into a scalar on the subsequent line of your script: $_ = <file1>;