Пример программы
while (<>) { $org=$_; s/\\["']//g; s/\/\/[^:].*//; s/\/\*.*\*\///g; if ($comment == 1) { if (s/.*\*\///) { $comment = 0; } else { next; } } if (s/\/\*.*//) { $comment = 1; } if (/^\s*#/) { next; } }