I settled on this for the moment, as it preserves the order of the first list, which is a requirement.
Thank you for the suggestions@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
In reply to Re^3: split (grep)
by tbone654
in thread split (grep)
by tbone654
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |