in reply to Alphabetical Order

It looks like some of your code got cut off... but probably there was just a print statement down there. Anyway, I'll offer some tips.

First thing I'd do is take all those fields and stick them in a hash rather than a bunch of independent variables.

while (<DATAFILEIN>) { chomp; my %record; @record{ @fields } = split /\|/;
Then, rather than print it out right there -- since that would mean printing records in the order they come in -- I'll add each record's hash to an array of hashes, for sorting and printing later:
push @records, \%record; }
Note that I'll have to define the @fields array before the loop, something like this:
my @fields = qw( time company_name email member1 member1phone data time2 pictureurl password website member2 member2phone address citystatezip fax );
Now, after I've gotten all the record hashes into @records, I can sort them by company name and print them out:
for ( sort { $a->{'company_name'} cmp $b->{'company_name'} } @record +s ) { print "$_->{'company_name'} and other fields here.\n" }

Another thing you might consider... If the company names are unique, store the records in a hash keyed by company_name, rather than in an array. Something like this:

while (<DATAFILEIN>) { chomp; my %record; @record{ @fields } = split /\|/; $records{ $record{'company_name'} } = \%record; } # this makes the sorting a bit more straightforward: for ( sort keys %records ) { my %rec = %{ $records{$_} }; print "$rec{'company_name'} and other fields here.\n" }
Does that make sense? If you have any questions, let me know.

jdporter
...porque es dificil estar guapo y blanco.