Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have a couple of oddities. One, called incgrep, works like recursive grep except for two features. First, it reports one line for each file that has the search string with the line numbers after like this:
search_string: some_file 4 12 189 other_file 29 283
This is very useful for quickly seeing which files are calling a certain sub, etc.

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:

shell-prompt: incgrep global/template/dir form.tt: App/Main.pm 24 114 App/Modules/Name.pm 41 error.tt: App/Main.pm 181
I don't actually use it that way much.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-18 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found