in reply to Re^7: constructing a tree from csv file
in thread constructing a tree from csv file

Choroba i modified your code for my requirements and now %group hash has 40 keys, and __DATA__ has 345 lines. The problem is that the code hangs and gets killed after sometime without any output. CPU usage going to 100%,system hang. Whereas if I reduce the __DATA__ lines to 300 lines only, then it runs . Why is it so. My system has 64Gigs ram, and hexacore.
  • Comment on Re^8: constructing a tree from csv file

Replies are listed 'Best First'.
Re^9: constructing a tree from csv file
by choroba (Cardinal) on Nov 19, 2013 at 09:36 UTC
    There is a cycle in your "tree". Trees should not contain cycles.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Thanks choroba. How can I stop the code from going beyond the parent Q. i.e. once it has reached Q it should stop checking further.  M420<-M143<-M10<-Q It should stop here and not go further beyond Q. Thanks
      I tried using "next"
      while ($parent = $tree{$parent}{parent}[0]) { if ( $parent eq 'Q' ) {next;}
      But its still getting hanged !!!!
        The cycle might not contain Q.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ