This is very useful for quickly seeing which files are calling a certain sub, etc.search_string: some_file 4 12 189 other_file 29 283
The second feature is odder yet. If the search string is a directory name, then instead of looking for the string itself, it uses the file names in that directory as search strings looking for each of them. This was supposed to be useful for looking for all the templates used in a project:
I don't actually use it that way much.shell-prompt: incgrep global/template/dir form.tt: App/Main.pm 24 114 App/Modules/Name.pm 41 error.tt: App/Main.pm 181
Another script is showsub. It usually takes a sub name and a module file name. It dumps out the whole sub from that module. (It's not very smart, it looks for 'sub name' at the left margin and dumps from there to the first closing brace at the margin.) It can also take the output from incgrep. Then it looks in all the files mentioned there for the sub provided.
Another one is searchinc. It takes a regex, a starting perl file and (optionally) a list of directories which could be part of @INC. It looks for the regex in the starting file and in anything it uses recursively. Again, its not overly smart and only looks for easy to spot use statements. I also have a version for C, since I once spent a bit of time digesting a large code base in C. The C version is more useful, Perl doesn't hide as many symbols.
My most useful little tools are the ones the move me to the directories where our different projects live. I can type cdb AppName to move the build directory for an app and cda AppName to move to the lib path for it. These are my most typed commands.
Phil
In reply to Re: Private Utilities
by philcrow
in thread Private Utilities
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |