while ($_ = ) { chomp; s/^((([^\#\\])|(\\.))*)\#.*$/$1/; print "$_\n"; }