in reply to hard-to-understand taint error
There is nothing like "user input" anywhere near this sequence
The contents of the directory are hardcoded? No.
>perl -MScalar::Util=tainted -Tle"opendir $dh, '.'; print(tainted(read +dir($dh))?1:0); 1 [download]