More Perl programming help on Usenet

Yesterday I posted a small Perl program to a Dutch Usenet group as a solution to a problem posted
by Kees de Koster. Today Kees posted more information on the problem, and his own solution written
in Perl. I replied with a modified version of the Perl program I posted yesterday which given the
input Kees posted reproduced the desired output.