while (my $fields = $csv->getline( $data )) { my $word = $fields -> [0]; my $pos_sent = $fields->[1]; my $neg_sent = $fields->[2]; my $topics = $fields->[3]; my @word_info = ($pos_sent, $neg_sent, $topics); # Trying with a reference my $pnt_word_info = \@word_info; $trie->add_data($word => $pnt_word_info); my $info = $trie->lookup_data($word); printf "Just added %s\n Sentiment: %s \t Neg Sentiment: %s \t Topic: %s\n", $word, $info->[0], $info->[1], $info->[2]; }