in reply to Re^2: split (grep)
in thread split (grep)

I settled on this for the moment, as it preserves the order of the first list, which is a requirement.

@foo = qw/tom steve bill roger bob/; @bar = qw/roger;99 steve;56 ted;88 tom;54/; foreach $line(@foo){ foreach $line1(@bar){ @split1=(split/;/,$line1); if($line =~ $split1[0]){ printf("%5s %3s\n",$split1[0],$split1[1]); } } } __END__ tom 54 steve 56 roger 99
Thank you for the suggestions