Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I can’t find any module named Graph::Subgraph on 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found