Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: how do I print content of a cpp file without cpp comments?by smokemachine (Hermit) |
on Sep 19, 2006 at 18:24 UTC ( [id://573784]=note: print w/replies, xml ) | Need Help?? |
perl -ne '($f.=$_)=~s;//.*$;;;END{$f=~s;/\*.*\*/|^\s*$;;gsm;print $f}' test.c
In Section
Seekers of Perl Wisdom
|
|