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";