Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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??


in reply to how do I print content of a cpp file without cpp comments?

perl -ne '($f.=$_)=~s;//.*$;;;END{$f=~s;/\*.*\*/|^\s*$;;gsm;print $f}' test.c