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

Thanks but Im getting this error :-
Use of uninitialized value in print at final.pl line 35, <DATA> line 7 +. , ,3: M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 35, <DATA> line 7 +. , ,0: M420<-M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 35, <DATA> line 7 +. , L,: M407<-M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 35, <DATA> line 7 +. , 0: M10<-Q = P, Use of uninitialized value in print at final.pl line 35, <DATA> line 7 +. , ,1: M421<-M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 35, <DATA> line 7 +. , L,: M406<-M143<-M10<-Q = P,

Replies are listed 'Best First'.
Re^7: constructing a tree from csv file
by choroba (Cardinal) on Nov 11, 2013 at 09:32 UTC
    Did you use the [download] link to get the code? Tab characters are used in the DATA section, plain spaces would break the programme.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Ohh yeah. BTW I must say, I leant a lot by simply reading through your code. Thanks it was lucidly written.
      Choroba I did it but again the same error-
      Use of uninitialized value in print at final.pl line 71, <DATA> line 7 +. , ,3: M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 71, <DATA> line 7 +. , ,0: M420<-M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 71, <DATA> line 7 +. , L,: M407<-M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 71, <DATA> line 7 +. , 0: M10<-Q = P, Use of uninitialized value in print at final.pl line 71, <DATA> line 7 +. , ,1: M421<-M143<-M10<-Q = P, Use of uninitialized value in print at final.pl line 71, <DATA> line 7 +. , L,: M406<-M143<-M10<-Q = P,
      LINE 71 being   print " = ", $path_string, ', ', $group{$path_string};
        You are not using tabs to separate the columns.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      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.
        There is a cycle in your "tree". Trees should not contain cycles.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Choroba the reason for uninitliazed error that Im getting is because my group hash doesnt have relations which are more than length 3. As you can see below. E.P.E.E is 4 relations. But thats alright as I dont want to have relations which are more than three. But could this also be the reaso n behind the program getting hanged when run on __DATA__ more than 300 lines:-
      Use of uninitialized value in print at checking.pl line 71, <DATA> lin +e 338. M61: M61<-M7<-M28<-M6<-Q = E.P.E.E, Use of uninitialized value in print at checking.pl line 71, <DATA> lin +e 338. M196: M196<-M53<-M7<-M28<-M6<-Q = E.P.E.Pl.E,
        To avoid the warnings, just do not print anything if the relation is not defined:
        print " = ", $path_string, ', ', $group{$path_string} // q();
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ