perl regular expression matching variable

How can perl language regular expressions match in multiple lines? Please give example

Can use join like

openFILE,$filename

ordie “Can’open’$filename’:$! ” ;

my$lines=join”,<FILE>;

$lines=~s/^/$filename:/gm;

Or use a loop

open(A, “file”);

while(<A>){

if(/aaa/… /bbb/){

print;

}

}

The above script is to print out only the lines between aaa and bbb.

open(A, “file”);

while(<A>){

unless(/aaa/.. /bbb/){

print;

}

}

The above script is printing out lines other than aaa to bbb.

A perl regular expression matching question?

/^([12])? \d:([0-5])? \d([ap]m)$/