Very neat program bikeNomad. I spotted some minor bugs/optimisations ... I must remark that that was no thorough testing, so I have probably left some more things to discover for other ;-)

delete($opts{l}); ## was: delete($opts{L});

typo ... otherwise there is an infinite loop with the l-option

# was: if (/@(?:([[:word:]:]+)::)?ISA\s*=\s*(.*)\s*/) if (/(?<!\\)@(?:([[:word:]:]+)::)?ISA\s*=\s*(.*)/)

I added a negative look-behind at the beginning to not allow a backslashed '@' in front of the ISA - so now even if run on the sourcecode itself (not that this is very sensible :) it produces no errors. Furthermore I removed the '\s*' at the end, this was unnecessary as everything is ate up anyway by the (greedy) '.*' .

while (!/;/) # accumulate ISA value for multiple lines { $_ = <$f>; $tmp .= $_; } @isa = eval $tmp; # was: if ($@) { warn "Unparseable \@ISA line: $_"; next }; if ($@) { warn "Unparseable \@ISA line: $tmp"; next };

The reason for creating the eval-error can be in any of the lines read in, not only in the last. Apart from that the error handling prints now always only the part after the equal sign.

-- Hofmator


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

Title:
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, details, 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, summary, 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.