Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^8: constructing a tree from csv file

by zing (Beadle)
on Nov 19, 2013 at 06:31 UTC ( [id://1063284]=note: print w/replies, xml ) Need Help??


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

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,

Replies are listed 'Best First'.
Re^9: constructing a tree from csv file
by choroba (Cardinal) on Nov 19, 2013 at 09:38 UTC
    To avoid the warnings, just do not print anything if the relation is not defined:
    print " = ", $path_string, ', ', $group{$path_string} // q();
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Choroba what if I dont want those lines which dont have a group (from the group hash) to be "even" printed ? For example a line which has relation : E.E.E.P.Pl doesnt have a corresponding key-value pair in the group hash, so I would like this complete row to not even get printed. I guess something has to be added in this line   print " , ", $path_string, ', ', $group{$path_string};
        Use a condition:
        print " , ", $path_string, ', ', $group{$path_string} if exists $group +{$path_string};
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1063284]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-24 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found