########################################## sub OPEN_200R { open(FILE, '<', 'CATAGORIES.DAT') or die("Could not open* file! CATAGORIES DAT\n"); @lines = ; close(FILE); $gcnt = 0; foreach (@lines) { ($catg) = (split(/,/)); $gcnt = $gcnt + 1; chomp $catg; $catg[$gcnt] = $catg; if ($gcnt <= 5) { $catlgs5 = join '', $catg[$gcnt]; }elsif ($gcnt >= 6){ $catlgs6 = join '', $catg[$gcnt]; } # end of if gcnt print ("$catlgs5"); print ("$catlgs6 \n"); # chomp $catg; } # end of foreach at 200r # { ########################################## #### Not results Expected. 1-AT&T 2-FP&L 3-WATER 4-GAS 5-PLAN-D 5-PLAN-D 6-AARP 5-PLAN-D 7-DIAZ 5-PLAN-D 8-DRUGS 5-PLAN-D 9-HOUSE 5-PLAN-D10-CAR 5-PLAN-D11-MISC