fix perl dependent modules, #5900 (#5937)
fix perl dependent modules, #5900 (#5937)

*  FIX perl dependent environmwent setup to avoid void lines in generated modules as #5900

* remove debug prints

* fix flake8

matthiasdiener/spack,mfherbst/spack,tmerrick1/spack,mfherbst/spack,krafczyk/spack,krafczyk/spack,LLNL/spack,tmerrick1/spack,skosukhin/spack,krafczyk/spack,EmreAtes/spack,skosukhin/spack,krafczyk/spack,EmreAtes/spack,iulian787/spack,EmreAtes/spack,matthiasdiener/spack,mfherbst/spack,mfherbst/spack,iulian787/spack,LLNL/spack,skosukhin/spack,EmreAtes/spack,matthiasdiener/spack,tmerrick1/spack,iulian787/spack,tmerrick1/spack,skosukhin/spack,iulian787/spack,matthiasdiener/spack,LLNL/spack,tmerrick1/spack,LLNL/spack,krafczyk/spack,mfherbst/spack,LLNL/spack,iulian787/spack,matthiasdiener/spack,EmreAtes/spack,skosukhin/spack