Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

My boss has given me a project which involves going through a rather large crontab, and creating a data flow diagram of it. Specifically, I need to determine what files/scripts a script is dependant upon, and what the output of the script is. Does anyone have any experience coding such a task?

Replies are listed 'Best First'.
Re: Data Flow Diagramming
by clemburg (Curate) on Feb 16, 2001 at 22:53 UTC

    Well, I don't know about the task of figuring out which program depends on what (maybe a cool regex task?), but I have a tip on the output part: have a look at GraphViz, and generate input for it (for the visualization part).

    There is even a Perl interface to it: GraphViz, although I can not speak for that (never used it, always generated GraphViz input files directly).

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com

Re: Data Flow Diagramming
by InfiniteSilence (Curate) on Feb 17, 2001 at 01:21 UTC
    This question has been asked before. To recap: this is a VERY difficult job to do in Perl, as there are so very many ways to introduce some type of external dependency. You may be able to knock out the most obvious dependencies by looking for use/require/do statements, but anything more complex will not have a regular structure, and thus will be harder to find programmatically.

    Celebrate Intellectual Diversity

Re: Data Flow Diagramming
by Anonymous Monk on Feb 17, 2001 at 02:57 UTC
    Thanks for the feedback. Sorry to reply to my own post, but I'me serious about taking on this endeavor. I came up with an idea that should take care of at least the external program dependency part.
    What if I:

    1. Pushed all of executable files within a given directory structure into an array.
    2. Parse each script contained in the crontab. If we have a match, push the match into a HoL, where key = script name, value = dependencies.
    Does this logic seem sound?