while () { next if /^#/; # or next if substr($_,0,1) eq '#'; $content .= $_; };