go ahead... be a heretic | |
PerlMonks |
Re: Bad Regexby RollyGuy (Chaplain) |
on Jun 23, 2003 at 18:02 UTC ( [id://268254]=note: print w/replies, xml ) | Need Help?? |
You should try Regexp::Common::comment for common regexes that match comments. It will probably be better than rolling your own.
As for the line count, you can simply keep a counter as you go through the lines of the file. So, set a variable outside of your foreach loop and increment each time to get the new line number.
In Section
Seekers of Perl Wisdom
|
|