Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When scripting, what's the difference between #!/usr/bin/perl and #!/usr/bin/env perl?

Obviously this applies equally with python, bash, sh, etc substituted for perl!

Quentin's answer below was clearly correct, and so I've accepted it, but I guess what I actually meant was 'what are the pros and cons of the two ways of using #! to invoke perl/python/bash as the interpreter of a script?'

like image 692
John Lawrence Aspden Avatar asked Sep 30 '11 10:09

John Lawrence Aspden


1 Answers

One references a common place that perl is installed. The other references a common place that env is installed and asks it what the path to the default perl is.

like image 165
Quentin Avatar answered Oct 24 '22 11:10

Quentin