m/ \n id: # Match new line followed by id: [^\n]* # 0 or more characters that are not new lines \n # A newline ([^\n]*\n){4}) # The next 4 lines and store in $1 /x; # Ignore whitespace