http://www.perlmonks.org?node_id=1213158


in reply to Re^2: shebang anomaly
in thread shebang anomaly

Apart from all the examples given, there is a script in that page called "cmd" which allegedly will solve your problem by using: #!cmd /usr/bin/env perl -w. However, unless I am doing something wrong, it does not work for me. Although it should because what it does is straight-forward: breaks the command line and spawns yet another perl process with these args and your actual perl script.

Maybe you will have better luck than me if you were to try having two shell scripts perlw.sh and perlwd.sh calling perl differently?