Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://573784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found