marvi has asked for the wisdom of the Perl Monks concerning the following question: (object-oriented programming)

Is there a tool that generates UML diagrams from Perl source code?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: Generate UML from Perl code?
by Zaxo (Archbishop) on Aug 06, 2001 at 04:20 UTC
Re: Generate UML from Perl code?
by htoug (Deacon) on Aug 06, 2001 at 10:23 UTC
    Simon Johnston <sjohnsto@rational.com> has written a Perl AddIn for Rose. He talked about it at TPC4. You can find it at: http://www.rationalrose.com/addins/RosePerl-1_0_1.htm
Re: Generate UML from Perl code?
by bikeNomad (Priest) on Aug 06, 2001 at 21:10 UTC
    The code I posted at Graph your Perl inheritance structure will draw an inheritance diagram from an existing Perl program. You should be able to modify it to make UML diagrams pretty easily. But you won't be able to edit them graphically.

    But you don't say what UML diagrams you're interested in (there are lots of different kinds). Some possibilities that I can think of for diagramming:

    • use the debugger hooks to build a sequence or collaboration diagram
    • analyze the @ISA structure for a class diagram like my example does
    • analyze your POE structures for a class diagram
    • analyze the 'use' and 'require' structures (you can use the debugger hooks here too) for a component diagram
Re: Generate UML from Perl code?
by stajich (Chaplain) on May 20, 2002 at 13:47 UTC
    Another good option is AutoDia which will produce XML suitable for the Dia drawing program. Typically you'll need to so some editing of the diagram after generation, but it seems to get the inheritance down okay. I like it as a starting point rather than building the whole class hierarchy by hand.