my @store; foreach my $line (@$lines) { my @val = split(/\,/,$line); push (@store,@val[2]); } printf "@store\n";