in reply to How to print the lines immediately above and below a matching line?
if ($this_line =~ /<DATA>/) {Are you trying to read from the special DATA handle, or are you trying to match the exact string <DATA>? re indicates you are doing the latter:
perl -Mre=debug mycode.pl Compiling REx "<DATA>" Final program: 1: EXACT <<DATA>> (4) 4: END (0) anchored "<DATA>" at 0 (checking anchored isall) minlen 6 Error opening file - No such file or directory Freeing REx: "<DATA>"
|
|---|