Sorry about first post!
I'm no perl pro - so _please_ help me with this question. How does one create a list of structs that contain a list of structs? Or even a struct that contains a list of structs? This code doesn't work and I don't know why:
It won't print anything! I think it must be some syntactic error, but from the O'Reilly books I have it looks like it's correct. This shouldn't be too difficult :)I would also eventually want DiscourseSegment to be a list too.use Class::Struct; struct DiscourseSegment => { intonation_step=>'$', speed_step=>'$', fluctuation_step=>'$', phrasenumber=>'$', #total number of phrases p => '@', #these should be of type Phrase }; struct Phrase => { text => '$', marking => '$', # 1 = SBEG, 2 = SF intonation => '$', #the level of intonation speed => '$', fluctuation => '$' }; $ds = (); $j = 0; $ds = DiscourseSegment->new(); $ds->p(["hey","you"]); @temp = $ds->p(0); print "*" x 30; $temp2 = $temp[0]; print "$temp2";
Hhalpiin
P.S. - If perlmonks doesn't automatically do this, please e-mail me your response. Thanks! It will never print "hey you"
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |