in reply to Applying a regex across multiple files

Just slurp your entire file into a single scalar (from what you describe it soulds like you're doing line-by-line processign with a while loop now). If you're processing like this now:
while(<>){ #examine one line }
you can slurp the whole stream into a scalar with
my $s=join '',<>;
and then process with a normal regular expression. Use the s flag on your regular-expression to get it to span lines.
if($s=~/foo\s*(\d+)\s*bar/s){ ... }