in reply to Flat File Question

As suggested above, you want to use a hash-of-arrays (HoA) to store the "sub-*" records from the second flat file, keyed by company name. It would also be useful for the strings from the first flat file to be stored in a simple hash as well (as you read from that file), again keyed by company name. So, somthing like this to read the two files:
my %f1hash; my %f2hash; my $f1 = "company_file.dat"; my $f2 = "other_file.dat"; open( F, $f1 ) or die "can't open $f1: $!"; while (<F>) { chomp; my ( $co, $url, $dir ) = split /\|/; $f1hash{$co} = "$co, $url, $dir<BR>\n"; } close F; open( F, $f2 ) or die "can't open $f2: $!"; while (<F>) { chomp; my ( $co, $url, $dir, $mdir ) = split /, */; push( @{$f2hash{$co}}, " -$co $url $dir<BR>\n"; warn "$f2 contains $co, not found in $f1\n" unless exists( $f1hash +{$co} ); } close F;
Then when you're printing stuff out, do something like this:
for (sort keys %f1hash) { print $f1hash{$_}; print @{$f2hash{$_}}; }