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

yes, that's why i suggested it .. I would (you ignored my questioned about providing code, so i'll continue just guiding with pesudo code until you have something to work from) set $/, then loop through the 'lines' (which will contain multiple \n newlines). During this loop, split on newline to get your array of 4 lines. Note the first one will be just a number (the remainder of the '# input 3' line) and the last one will be '# input ' ($/).