Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
This is very neat. I have made a patch (see below) that:
  • Makes it ignore POD lines.
  • Makes it deal with multi-line @ISA declarations such as:
    Of course, the only foolproof way to get @ISA would be to load the package and examine its value, but this seems to work OK.
For an example of a graph generated by this program, see this graph, which corresponds to the implementation of this project. :-)


Here's the patch:

--- Sun Jun 10 16:52:08 2001 +++ Sun Jun 10 17:00:00 2001 @@ -86,16 +86,31 @@ STDERR->print("processing $file\n") if $opts{v}; my $f = IO::File->new($file) or warn "can't open $file: $!\n", next; my ($package, @isa); + my $pod=0; while (<$f>) { + if (/^=cut/) { + $pod=0; + next; + } + if (/^=[a-zA-Z]+/) { + $pod=1; + next; + } + next if $pod; if (/^\s*package\s+([[:word:]:]+)\s*;/) { $package = $1; next; } - if (/@(?:([[:word:]:]+)::)?ISA\s*=\s*(.*)\s*;/) + if (/@(?:([[:word:]:]+)::)?ISA\s*=\s*(.*)\s*/) { - @isa = eval $2; + my $tmp=$2; + while (!/;/) { + $_=<$f>; + $tmp.=$_; + } + @isa = eval $tmp; if ($@) { warn "Unparseable \@ISA line: $_"; next } $package = $1 if defined($1); STDERR->print("package=$package, \@ISA=", join(',', @isa), "\n") i +f $opts{v};

In reply to Re: Graph your Perl inheritance structure by ZZamboni
in thread Graph your Perl inheritance structure by bikeNomad

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (3)
    As of 2018-04-21 02:56 GMT
    Find Nodes?
      Voting Booth?