my $count = 0; ... for my $vk (@vk) { if ($count != 10) { print OUT $vk.';'; ++ $count; } else { print OUT "\n"; $count = 0; } }
I think there's a problem with the quoted code:
Where did THREE and SEVEN go? Another vote for a functional approach. (But the quoted code is easily fixed.)c:\@Work\Perl\monks>perl -wMstrict -e "my $count = 0; my @vk = qw(zero one two THREE four five six SEVEN eight nine ten); ;; for my $vk (@vk) { if ($count != 3) { print $vk.';'; ++ $count; } else { print qq{\n}; $count = 0; } } " zero;one;two; four;five;six; eight;nine;ten;
Give a man a fish: <%-{-{-{-<
In reply to Re^2: Removing doubles and printing only unique values
by AnomalousMonk
in thread Removing doubles and printing only unique values
by zarath
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |