Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I can’t find any module named Graph::Subgraph on CPAN or meta::cpan. When I comment out the line use Graph::Subgraph; and run the code, I get the error you describe. The strict pragma is telling you that the syntax is wrong, so removing strict here would merely make the problem harder to identify!

I’m not sure what the code in this for loop is meant to achieve, but perhaps something as simple as

for my $src (keys %h) { $g->add_edge($src, $h{$src}); }

will do what you want? If so, that leads to another, similar, "strict refs" error in the line $allgraphs[-1]{$node} = [ @{ $h{$node} } ];. But since I don’t understand what this final for loop is doing, I’m afraid I can’t offer any help here.  :-(

Tip: In future, please show the minimum code that demonstrates the problem, and explain exactly what the code is intended to do. Comment the code liberally. See How do I post a question effectively?.

Update: Just discovered, this issue has been re-addressed in Finding connected components in a graph..

Athanasius <°(((><contra mundum


In reply to Re^5: How to save first two columns of an array into another array by Athanasius
in thread How to save first two columns of an array into another array by zing

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (8)
    As of 2014-07-14 07:17 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (256 votes), past polls