On the suggestion of mst, which I totally agree with.
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index 515ee8e..e3176e5 100644 (file)
@@ -58,7 +58,9 @@ sub mk_app {
     $self->{script          } = File::Spec->catdir( $self->{dir}, 'script' );
     $self->{appprefix       } = Catalyst::Utils::appprefix($name);
     $self->{appenv          } = Catalyst::Utils::class2env($name);
-    $self->{startperl       } = "#!$Config{perlpath} -w";
+    $self->{startperl       } = -r '/usr/bin/env' 
+                                ? '#!/usr/bin/env perl' 
+                                : "#!$Config{perlpath} -w";
     $self->{scriptgen       } = $Catalyst::Devel::CATALYST_SCRIPT_GEN || 4;
     $self->{catalyst_version} = $Catalyst::VERSION;
     $self->{author          } = $self->{author} = $ENV{'AUTHOR'}