no need for while loop
perl solutions