Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Grabbing Variable Names

by cecil36 (Pilgrim)
on Jan 11, 2003 at 22:16 UTC ( #226133=note: print w/replies, xml ) Need Help??

in reply to Grabbing Variable Names

When I took a class in compilers, our first project was to read in a source file written in Pascal, and match up the appropriate tokens for the variables, static values, and operators. I would take a similar approach. Since you know how perl identifies variables, you can write a script that will look for scalars, lists, and hashes by searching for the appropriate variable, and capturing it along with all the text up to the next symbol separating the variable from the rest of the program. I'm assuming that your input is a program that is not obfuscated.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://226133]
[shmem]: oh the whitespace in the regex got condensed, meh
[shmem]: should be /^ {7}(\w+)/ or such
[shmem]: least for my perldoc on Linux debian 8
[Discipulus]: mmh.. at themomemt i just an old 5.8 and outputs just GLOBAL::
[Discipulus]: anyway thanks! i've posted my font size suggestion anyway

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-05-23 10:10 GMT
Find Nodes?
    Voting Booth?