http://www.perlmonks.org?node_id=38287


in reply to How do I strip lines prefixed by a "#"

Another option:
my $infile = "template.dsc"; open (INFILE, "$infile") || die "Broken: $!"; my $content; read INFILE, $content, -s INFILE; $content =~ s/^#.*//m; close INFILE; ...

Replies are listed 'Best First'.
RE: Answer: How do I strip lines prefixed by a
by runrig (Abbot) on Oct 25, 2000 at 07:56 UTC
    correction: make that s/...//gm; oops! forgot the 'g' :-)