@mjgardner Thanks, I have both use strict and use warnings, but the script produced quite some lines of output and I guess the warnings got lost it the output. I guess I should've redirected the output to a file to have stderr more visible.
I'm on perl v5.38.2 and I didn't know about use v5.36, but I'm not sure it changes anything.
This #Linux, #Unix, #macOS, #FreeBSD shell feature comparison table shows that ZSH and FISH have the most features. Why aren't you using ZSH or FISH yet?