I try not to use so "clever" code as the other guys. :-) Maby I'm not that clever.... I like to use structure that I understand, and I'm a fan of hash. I like to read my data into a logical structur, and that it can be used for whatever I like after. Ex:

Code

#!/usr/bin/perl use strict ; use warnings ;

my (@array) = ("Group 1 \t 1 \t Joe \t some address 1", "Group 1 \t 3 \t Tim \t some address 3", "Group 1 \t 2 \t Dan \t some address 2") ; my(%data) ; foreach (@array){ my($group_id,$possision,$name,$address) = split("\t",$_) ; #Had to create a separat key, since I guess the key is the kombination of group and possision. #Alternativly you could create one hash for all the groups, and a new hash for each possision in the group. #The downside of that solution is that it will be more complex, but more generic. my($key) = "$group_id:$possision" ; $data{$key}{group_id} = $group_id ; $data{$key}{possision} = $possision ; $data{$key}{name} = $name ; $data{$key}{address} = $address ; }