Answer 1: Grind out a matrix by hand
Answer 2: Perl!
Submitted as a CUFP for to bringing perl to the realm of pointy haired bosses.
use strict; use warnings; my %old=( # 'Old Team Leader' => ['list','of','persons','reporting','to','this +','team','leader'] 'Beatrice' => ['Charles','Andrei','Ian','Patritzia','Violet','Mart +in','Norbert','Oliver','Mark','Harriet','David'], 'Fran' => ['John','Tracy','Albert','Larry','George','Marvin','Jam +es','Ray'], 'John' => ['Inigo','Kalen','Juliet'], 'Albert'=> ['Dean','Andrew'], 'Edward' => ['Charles','Randall','Robert','Colin'], 'Charles' => ['Shawn','Jon'], 'Daphne' => ['Beatrice','Fran','Wayne','Edward'] ); my %new=( # 'New Team Leader' => ['list','of','persons','reporting','to','this +','team','leader'] 'Charles' => ['Oliver','Norbert','Mark','Robert'], 'David' => ['Newboy','Randall'], 'Edward'=> ['Andrew','Patritzia','Larry','Tracy','Albert'], 'John' => ['Martin','Inigo','Juliet','Kalen'], 'James' => ['Fran','George','Jon','Shawn'], 'Beatrice' => ['Wayne','Charles','David','Edward','Dean','John','J +ames'], 'Edward' => ['Harriet','Ray'] ); my @nobody = (); sub oldreports { @{$old{$_[0]} || \@nobody}; } sub newreports { @{$new{$_[0]} || \@nobody}; } sub oldtl { my $who=shift; for my $lm (keys %old) { for my $rep (oldreports($lm)) { return $lm if ($who eq $rep); } } return ''; } for my $newtl (sort keys %new) { my %needtomeet; for my $rep (newreports($newtl)) { my $oldtl=&oldtl($rep); push @{$needtomeet{$oldtl}},$rep if ($oldtl); } print "\n$newtl needs to meet with "; for my $oldtl (keys %needtomeet) { next if ($oldtl eq $newtl); print "\n\t$oldtl to discuss\n"; for my $reps ($needtomeet{$oldtl}) { for my $rep (@$reps) { next if (($rep eq $newtl) or ($rep eq $oldtl)); print "\t\t$rep\n"; } } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Restructuring Teams with Perl
by jeffa (Bishop) on Jun 12, 2003 at 00:28 UTC |