in reply to Trouble matching more than one line

Well, there are different ways that you can do this, but they all revolve around one central point: you need to define how much context you are interested in searching.

If, as you say, you just undef $/, meaning, I assume, that you read an entire file into $Hap, then your regular expression is too broad. You have .* before and .* after the key bit of text... this means that you'll be matching the entire file. (Even if you limited the regular expression, though, you're printing $Hap, not printing just the portion of the string that matched the regexp.)

In order to handle that properly, you'd want to be clear in your regular expression where you wanted to begin your match... like maybe: /void .*?INT8U.*?\)/. Also, you'd want to capture the match: /(void .*?INT8U.*?\))/ and then reference the captured text: print $1;.

Anyway, another entirely different way to deal with it is to use the same regular expression, but set $/ to an appropriate value, so that you split your input into the chunks that you are interested in. Maybe, for example, by setting $/ to "\n\n". That would break up your input into paragraphs (which may or may not be what you want). Anyway, I can't really tell more, because your question is a little vague.


------------
:Wq
Not an editor command: Wq