Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Answer: How do I strip lines prefixed by a

by runrig (Abbot)
on Oct 25, 2000 at 07:55 UTC ( #38287=categorized answer: print w/replies, xml ) Need Help??

Q&A > regular expressions > How do I strip lines prefixed by a "#" - Answer contributed by runrig

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' :-)
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2016-12-04 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (69 votes). Check out past polls.