while (<DATA>) { s/\s#.*//; next unless /\S/; do_something($_); } __DATA__ # This is my file # with a few lines of comments data=here # another comment more=data # more comments and=more # end of file
In reply to Re: How do I strip lines prefixed by a
by Fastolfe
in thread How do I strip lines prefixed by a "#"
by Coplan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |