Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: replace java code when not commented

by gube (Parson)
on Mar 28, 2006 at 05:41 UTC ( [id://539622]=note: print w/replies, xml ) Need Help??


in reply to replace java code when not commented

#!/usr/local/bin/perl while(<DATA>) { $_ =~ s/^(public[^\n]+)/\/\*$1\*\//si; print $_; } __DATA__ /** * public void method1(); * is deprecated */ public void method1();

Replies are listed 'Best First'.
Re^2: replace java code when not commented
by zer (Deacon) on Mar 28, 2006 at 05:58 UTC
    this is good! Use gubes method. heres my extention applied to it.
    while(<DATA>) { $_ =~ s/^\s*((public|private)[^\n]+)/\/\*$1\*\//si; print $_; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found