Hello oldcity,
Here’s a guess at what you’re looking for:
use strict; use warnings; OPEN_200R(); sub OPEN_200R { my @lines = <DATA>; my $gcnt = 0; my @catg; my $catlgs5 = ''; my $catlgs6 = ''; for (@lines) { my ($catg) = split ' '; ++$gcnt; chomp $catg; $catg[$gcnt] = $catg; if ($gcnt <= 5) { $catlgs5 .= '|' . $catg[$gcnt]; } elsif ($gcnt >= 6) { $catlgs6 .= '|' . $catg[$gcnt]; } } print "5: $catlgs5\n"; print "6: $catlgs6\n"; } __DATA__ 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
Output:
12:55 >perl 1942_SoPW.pl 5: |1-AT&T|2-FP&L|3-WATER|4-GAS|5-PLAN-D 6: |5-PLAN-D|5-PLAN-D|5-PLAN-D|5-PLAN-D|5-PLAN-D10-CAR|5-PLAN-D11-MISC 12:55 >
Notes:
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Unexpected Results
by Athanasius
in thread Unexpected Results
by oldcity
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |