in reply to Counter && print issue

To answer your second question. Checking the return code from system() is useless towards what you wanted to do. What you want to check is $?. That perlvar has an English name $CHILD_ERROR, which clearly explains itself ;-)