in reply to Re^4: print matching lines
in thread print matching lines

Since the purpose of setting $/ (see http://perldoc.perl.org/perlvar.html#$/) is to change what <> reads, you need to have it set before the loop. while(<>) will still put the input in $_; don't expect $/ to change.

Hint: try a simple loop:

local $/ = "# input"; while (<FH>) { print "got record:\n", $_, ":end of record\n"; }
then try to come up with a regex to match the records you want and print the appropriate thing. You'll need the //m flag.

Another perfectly fine approach would be to leave $/ unchanged and save the line(s) you want to print, then print them if and when you get "ord".