for (@data2) { chomp; if( m[/\*] ) { $_ .= until m[\*/]; s[ \s? / \* .+? \* / \s? ][]smgx; # Get rid of comments, we aren't interested in checking comment conten t chomp; }