'a'=~/(.)/; print("$1\n"); # a while ( 'b'=~/(.)/ ) { print("$1\n"), # b last; } print("$1\n"); # a #### my $comment_re = qr{/\*.*?\*/;}s; my ($comment, $rest); while (!( ($comment, $rest) = $statement =~ m{^($comment_re)(.*)}s )) { defined( my $line = <$file> ) or die "Premature EOF.\n"; $statement .= $line; } print("Found type 1 comment: $comment\n");