Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
The stupid question is the question not asked
 
PerlMonks  

Re: Graph your Perl inheritance structure

by Hofmator (Curate)
on Jun 14, 2001 at 09:58 UTC ( [id://88343]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Graph your Perl inheritance structure

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://88343]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.