in reply to Reading content of many files in an array

Instead of pushing each $line onto @allmembers as its own element, you could chomp the @members array then join the contents of @members into a string. Pushing this string onto @allmembers should then be what you want...
foreach my $member ( .... ) { .... close(FILE); chomp @members; my $bigline = join(' ',@members); push(@allmembers,$bigline); .... } for my $longline (@allmembers) { print "$longline\n"; }
Update added my to original foreach loop var per tilly's wise words.

-Blake