Q&A > regular expressions > How do I strip lines prefixed by a "#" - Answer contributed by runrig
my $infile = "template.dsc";
open (INFILE, "$infile") || die "Broken: $!";
read INFILE, $content, -s INFILE;
$content =~ s/^#.*//m;
There is no Extraterrestrial life
There aren't any suitably capable Extraterrestrials
Interstellar travel is too difficult
We're too uncool / not worth the trouble
What do you mean they haven't visited?
Results (494 votes). Check out past polls.