#!/usr/bin/perl $/ = undef; $_ = <>; s/([^#"']*(['][^']*['])|(["][^"]*["]))|([#][^\n]*)/defined $1 ? $1 : ""/gse; print;