I want to run perl -w
using env
. That works fine on the command line:
$ /bin/env perl -we 'print "Hello, world!\n"'
Hello, world!
But it doesn't work on the shebang line in a script:
#!/bin/env perl -w
print "Hello, world!\n";
Here is the error:
/bin/env: perl -w: No such file or directory
Apparently env
doesn't understand the -w
flag that I'm passing to perl
. What's wrong?