#
/^^ \h* $$ # Match a line that only contains horizontal whitespace, if anything (blank line).
( # Capture to $1.
[ # Group, but don't capture.
^^ \# # Comment delimiter at the start of a line.
.* $$ # Everything until the end of the line, includes the newline.
]+ # One or more comment lines in a row.
) # End $1 capture.
$id # The key we're looking for. This matches as a literal string, not a pattern.
/
#
####
m/^^ \h* $$ $ret:=([^^ \# .* $$]+) $id/;