Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Capture uncommented keywords

by atcroft (Abbot)
on Jul 27, 2015 at 20:59 UTC ( [id://1136516]=note: print w/replies, xml ) Need Help??


in reply to Capture uncommented keywords

I cannot use CPAN or any other libraries.

Actually, Yes, even you can use CPAN. If nothing else, you could copy code from a module and put it directly in your script, although you would not benefit from potential bug fixes, etc. (I would question why this artificial limitation exists, however.)

As to the main question, it seems like the easiest thing would be to first remove comment lines (using either regexes or, more likely, a state machine), then process the remainder.

Hope that helps.

Replies are listed 'Best First'.
Re^2: Capture uncommented keywords
by ExReg (Priest) on Jul 27, 2015 at 21:23 UTC
    I do like CPAN and use it at home; I just can't use it at work. The removing all the commented out code first is a possibility, but I would much prefer a means to find these via regex alone. The script I am working on allows checking for new constructs by simply writing a regex and adding it with a name to a module. Need to find a new thing? Add a regex to a hash. Done. The old way took dozens of scripts tens of thousands of lines of perl. The new way, less than 500.
Re^2: Capture uncommented keywords
by ExReg (Priest) on Jul 27, 2015 at 21:12 UTC
    It would require that I type the CPAN source code into one computer while reading it from the other. No other way. Period.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-19 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found