in reply to Reconstructing List Order From Partial Subsets

This just prints out what is found in file that is declared in the predefined list, although I suspect (but don't know) you want more than this, e.g. to compare the two orderings and organise the result of that in some way.
my @baselist = qw ( alpha beta etc ); # or from wherever my %baselist = (); $baselist{ $baselist[$_] } = $_ for ( 0..$#baselist ); # find baselist in the order it appears in input my %rank = (); my $rank = 0; while(<>) chomp; defined( $baselist( $_ ) ) or next; if ( defined( $rank{ $_ } ) { warn "duplicate entry at line $.\n"; } else { $rank{ $_ } = ++$rank; } } # print order actually found print "$_\n" for sort { $rank{$a} <=> $rank{$b} } keys %rank;

-M

Free your mind