open PAGE, "$website" or die "Cant open $website: $!"; flock (PAGE, 1) or die "Can't lock website file for reading"; while (my $line = ()) { ($Prop,$colour,$txtcol,$url360,$user,$your_name,$address,$town,$zip_code,$country,$email,$telephone_no,$telephone_no2,$theme,$web_address,$ppemail,undef,undef,undef) = split "\t", $line; #create array of users and hash of data $onprop{$Prop} = [$Prop,$colour,$txtcol,$url360,$user,$your_name,$address,$town,$zip_code,$country,$email,$telephone_no,$telephone_no2,$theme,$web_address,$ppemail]; push (@dataarray, $user); } #iterate over users while (<@dataarray>) { my @microdata; #remove examine first user my $item = shift (@dataarray); foreach my $scalar (keys %onprop) { unless (! $item) { #compare lines of hash looking for lines with same user if ( @{ $onprop{ $scalar } }[4] eq $item) { #if found, remove from array my $a = shift(@dataarray); push (@microdata, @{ $onprop{ $scalar } }); } } } #store all results for this owner in single reference my $refmicro = \@microdata; push (@group, $refmicro); } foreach (@group) { print "@{ $_ }

"; }