in reply to Code struct map building?

jumash,

perhaps, you can delegate the parsing to B::Xref for each file and just parse & format the generated output as desired?

From the docs:

The B::Xref module is used to generate a cross reference listing of all definitions and uses of variables, subroutines and formats in a Perl program. It is implemented as a backend for the Perl compiler.

Update:
Concerning ready2work product - I didn't used it yet, but the following node should be worth a visit: Natural Doc - Create fancy documentation for your Perl code.

Replies are listed 'Best First'.
Re^2: Code struct map building?
by jumash (Novice) on May 13, 2010 at 09:21 UTC
    I tried to use Xref - but lot of scripts contain DB-operations, modifying or evel deleting information.

    And, it is a bad idea to make triggers in hundred of scripts.

    That's the reason i'm searching for a some magic tool which will show me subs callings without compilation :(

    As for NaturalDocs - i also tried this - but as i said, the project is poorly PODed - and ND generates only a list of subs, which're DECLARED in scripts, NOT called. Sorry for my bad english :)

      Sorry for my bad text parsing capabilities this morning ;-)

      Well, I think such magic tool does not exist. Static structure can be Xref'ed but the run-time behavior depends on program-state, DB-information, time(?), etc. - something which might be documented by logging (e.g. for example sections of the docs and for analysis of program behavior). Beyond that, all tools rely on some commenting conventions to document the program semantics.

      What is the initial requirement anyhow? Do you want to compile a handbook (documentation) or do you want to chart a map of a given software package (orientation, job training)?

      In the long run, analyzing and (re-)documenting the code according to the conventions of the documentation tool you have chosen is the price to pay (aka tedious code maintenance work).

        >>What is the initial requirement anyhow? I need to chart a map :) For better orienting in that horror code when a new programmer comes or when committing a dumb patch that crashes a system. In this time we cannot afford to cover all the code with units and searching for a magic-tool to handle a bit that ancient horror:) Sadly, it is idea of PMs - but work is work:)

        -- For now - the only decision i have - is a bad-percentage analyzer built on regexes, they firstly remove some part of 'garbage' (use, require, vars, qq[] constructs etc) from code and suppose that remaining shit is a pool of sub calls. Of course it is a really bad solution - considering that sub-calls may be built dynamically, etc.

        Now i'm examining the Devel::Call* section of CPAN - maybe, i can recieve some kind stack of subcalls with -d param..:)