Suddenly the script is working!

I installed strawberry perl, went back to the script that had previously
worked, edited out all my little attempts at troubleshooting,
and--voila!!!--it worked as it did before it stopped working.

Thanks for all your help and encouragement.