in reply to Multiline Regex
my $str = "this\nis my short\nstring\n"; my $regex = 'my'; open my $FH, '<', \$str or die $!; while ( <$FH> ) { print "Matched Line $_" if /$regex/; } [download]