{"thread":{"id":"13931","subject":"git-instaweb portability issue (maybe?)","startedAt":"2008-06-13T13:26:29Z","lastAt":"2008-06-13T15:39:13Z","messageCount":14,"participants":["Denis Bueno","Asheesh Laroia","Chris Ridd","Luciano Rocha","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"79714","messageId":"6dbd4d000806130626pfdb06f2qbfea6f1909710b7b@mail.gmail.com","threadId":"13931","inReplyTo":null,"subject":"git-instaweb portability issue (maybe?)","fromName":"Denis Bueno","fromEmail":"dbueno@gmail.com","sentAt":"2008-06-13T13:26:29Z","receivedAt":"2008-06-13T13:26:29Z","isPatch":false,"sender":{"key":"dbueno@gmail.com","avatar":"https://gravatar.com/avatar/591be06714161d33b59a485e6b822cbd40ecc0b91fd188b9924ea22c405996f7?d=mp&s=160"},"body":"Hi,\n\nI'm on OS X 10.4.11 on Intel using git 1.5.5.3.\n\nI'd been trying to use the git-instaweb script (both with and without\narguments) with lighttpd (which I installed through Macports) without\nsuccess, seeing the following kind of bizarre error message:\n\n    funsat[290] > git instaweb\n    /opt/local/bin/git-instaweb: line 6033: /usr/bin/env perl: No such\nfile or directory\n    2008-06-13 09:09:31: (log.c.75) server started\n\n    funsat[291] > 2008-06-13 09:09:31: (mod_cgi.c.998) CGI failed:\nExec format error /Volumes/work/funsat/.git/gitweb/gitweb.cgi\n    mod_cgi.c.1001: aborted\n    2008-06-13 09:09:31: (mod_cgi.c.584) cgi died, pid: 23237\n\n\"/usr/bin/env perl: No such file or directory\"? Huh?  I certainly have\nperl installed, so I don't know what that's about.\n\nThat line simply calls perl by the $PERL variable, which is set at the\ntop of the script, like so:\n\n    PERL='/usr/bin/env perl'\n\nIf I change this line to point to my perl directly, it works.  On a\nhunch, I changed it to:\n\n    PERL=\"/usr/bin/env perl\"  # note the double-quotes\n\nAnd now it works.  Could this be changed for future releases of git?\nDoes this in fact increase portability, or is something more sinister\ngoing on?\n\nThanks.\n\n-- \n Denis\n"},{"id":"79715","messageId":"6dbd4d000806130638k4461a41eo8ce6fe803505fa88@mail.gmail.com","threadId":"13931","inReplyTo":"6dbd4d000806130626pfdb06f2qbfea6f1909710b7b@mail.gmail.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Denis Bueno","fromEmail":"dbueno@gmail.com","sentAt":"2008-06-13T13:38:18Z","receivedAt":"2008-06-13T13:38:18Z","isPatch":false,"sender":{"key":"dbueno@gmail.com","avatar":"https://gravatar.com/avatar/591be06714161d33b59a485e6b822cbd40ecc0b91fd188b9924ea22c405996f7?d=mp&s=160"},"body":"On Fri, Jun 13, 2008 at 09:26, Denis Bueno <dbueno@gmail.com> wrote:\n> That line simply calls perl by the $PERL variable, which is set at the\n> top of the script, like so:\n>\n>    PERL='/usr/bin/env perl'\n>\n> If I change this line to point to my perl directly, it works.  On a\n> hunch, I changed it to:\n>\n>    PERL=\"/usr/bin/env perl\"  # note the double-quotes\n\n[snip lies]\n\nApparently I didn't test this thoroughly enough, and I was wrong.\nChanging the quotes has no effect.\n\nSo git-instaweb only works for me if I manually specify my perl path.\nCan anyone think of why this might be?\n\n-- \n Denis\n"},{"id":"79716","messageId":"alpine.DEB.1.10.0806130946060.8043@alchemy.localdomain","threadId":"13931","inReplyTo":"6dbd4d000806130638k4461a41eo8ce6fe803505fa88@mail.gmail.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Asheesh Laroia","fromEmail":"asheesh@asheesh.org","sentAt":"2008-06-13T13:46:32Z","receivedAt":"2008-06-13T13:46:32Z","isPatch":false,"sender":{"key":"asheesh@asheesh.org","avatar":"https://avatars.githubusercontent.com/u/25457?v=4"},"body":"On Fri, 13 Jun 2008, Denis Bueno wrote:\n\n> On Fri, Jun 13, 2008 at 09:26, Denis Bueno <dbueno@gmail.com> wrote:\n>> That line simply calls perl by the $PERL variable, which is set at the\n>> top of the script, like so:\n>>\n>>    PERL='/usr/bin/env perl'\n>>\n>> If I change this line to point to my perl directly, it works.  On a\n>> hunch, I changed it to:\n>>\n>>    PERL=\"/usr/bin/env perl\"  # note the double-quotes\n>\n> [snip lies]\n>\n> Apparently I didn't test this thoroughly enough, and I was wrong.\n> Changing the quotes has no effect.\n>\n> So git-instaweb only works for me if I manually specify my perl path.\n> Can anyone think of why this might be?\n\nDoes OS X ship /usr/bin/env?\n\nIf you type \"/usr/bin/env perl\" in a Terminal window, do you get Perl?\n\n-- Asheesh.\n\n-- \nHark ye, Clinker, you are a most notorious offender.  You stand convicted of\nsickness, hunger, wretchedness, and want.\n \t\t-- Tobias Smollet\n"},{"id":"79718","messageId":"6dbd4d000806130659r2a8bc57ev6db4ef058ee97440@mail.gmail.com","threadId":"13931","inReplyTo":"alpine.DEB.1.10.0806130946060.8043@alchemy.localdomain","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Denis Bueno","fromEmail":"dbueno@gmail.com","sentAt":"2008-06-13T13:59:12Z","receivedAt":"2008-06-13T13:59:12Z","isPatch":false,"sender":{"key":"dbueno@gmail.com","avatar":"https://gravatar.com/avatar/591be06714161d33b59a485e6b822cbd40ecc0b91fd188b9924ea22c405996f7?d=mp&s=160"},"body":"On Fri, Jun 13, 2008 at 09:46, Asheesh Laroia <asheesh@asheesh.org> wrote:\n> Does OS X ship /usr/bin/env?\n>\n> If you type \"/usr/bin/env perl\" in a Terminal window, do you get Perl?\n\nSorry, I should have made that clear earlier: yes.\n\nfunsat[122] > /usr/bin/env perl --version\n\nThis is perl, v5.8.8 built for darwin-2level\n\n\n-- \n Denis\n"},{"id":"79719","messageId":"48527FEC.8080909@isode.com","threadId":"13931","inReplyTo":"6dbd4d000806130659r2a8bc57ev6db4ef058ee97440@mail.gmail.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Chris Ridd","fromEmail":"chris.ridd@isode.com","sentAt":"2008-06-13T14:10:52Z","receivedAt":"2008-06-13T14:10:52Z","isPatch":false,"sender":{"key":"chris.ridd@isode.com","avatar":null},"body":"Denis Bueno wrote:\n> On Fri, Jun 13, 2008 at 09:46, Asheesh Laroia <asheesh@asheesh.org> wrote:\n>> Does OS X ship /usr/bin/env?\n>>\n>> If you type \"/usr/bin/env perl\" in a Terminal window, do you get Perl?\n> \n> Sorry, I should have made that clear earlier: yes.\n> \n> funsat[122] > /usr/bin/env perl --version\n> \n> This is perl, v5.8.8 built for darwin-2level\n\nMacPorts /tends/ to make ports use stuff from other ports instead of \nusing Apple-installed bits. In this case, maybe git from MacPorts is \nusing perl from MacPorts?\n\nCheers,\n\nChris\n"},{"id":"79720","messageId":"alpine.DEB.1.10.0806131016120.8043@alchemy.localdomain","threadId":"13931","inReplyTo":"48527FEC.8080909@isode.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Asheesh Laroia","fromEmail":"asheesh@asheesh.org","sentAt":"2008-06-13T14:16:36Z","receivedAt":"2008-06-13T14:16:36Z","isPatch":false,"sender":{"key":"asheesh@asheesh.org","avatar":"https://avatars.githubusercontent.com/u/25457?v=4"},"body":"On Fri, 13 Jun 2008, Chris Ridd wrote:\n\n> Denis Bueno wrote:\n>> On Fri, Jun 13, 2008 at 09:46, Asheesh Laroia <asheesh@asheesh.org> wrote:\n>>> Does OS X ship /usr/bin/env?\n>>> \n>>> If you type \"/usr/bin/env perl\" in a Terminal window, do you get Perl?\n>> \n>> Sorry, I should have made that clear earlier: yes.\n>> \n>> funsat[122] > /usr/bin/env perl --version\n>> \n>> This is perl, v5.8.8 built for darwin-2level\n>\n> MacPorts /tends/ to make ports use stuff from other ports instead of using \n> Apple-installed bits. In this case, maybe git from MacPorts is using perl \n> from MacPorts?\n\nFWIW, the problem seems to be that it's not finding *any* Perl.\n\n-- Asheesh.\n\n-- \nA can of ASPARAGUS, 73 pigeons, some LIVE ammo, and a FROZEN DAQUIRI!!\n"},{"id":"79721","messageId":"20080613142118.GA20027@bit.office.eurotux.com","threadId":"13931","inReplyTo":"6dbd4d000806130638k4461a41eo8ce6fe803505fa88@mail.gmail.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Luciano Rocha","fromEmail":"luciano@eurotux.com","sentAt":"2008-06-13T14:21:18Z","receivedAt":"2008-06-13T14:21:18Z","isPatch":false,"sender":{"key":"luciano@eurotux.com","avatar":null},"body":"On Fri, Jun 13, 2008 at 09:38:18AM -0400, Denis Bueno wrote:\n> On Fri, Jun 13, 2008 at 09:26, Denis Bueno <dbueno@gmail.com> wrote:\n> > That line simply calls perl by the $PERL variable, which is set at the\n> > top of the script, like so:\n> >\n> >    PERL='/usr/bin/env perl'\n> >\n> > If I change this line to point to my perl directly, it works.  On a\n> > hunch, I changed it to:\n> >\n> >    PERL=\"/usr/bin/env perl\"  # note the double-quotes\n> \n> [snip lies]\n> \n> Apparently I didn't test this thoroughly enough, and I was wrong.\n> Changing the quotes has no effect.\n\nThat makes more sense.\n\nTry changing the following line instead:\n\t\"$PERL\" -p -e \"$script\" \"$1.tmp\"  > \"$1\"\nto\n\t$PERL -p -e \"$script\" \"$1.tmp\"  > \"$1\"\n\nabout line 6121 of the git-instaweb script.\n\n-- \nLuciano Rocha <luciano@eurotux.com>\nEurotux Informática, S.A. <http://www.eurotux.com/>\n"},{"id":"79722","messageId":"m3abhpqusj.fsf@localhost.localdomain","threadId":"13931","inReplyTo":"6dbd4d000806130626pfdb06f2qbfea6f1909710b7b@mail.gmail.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-13T14:22:59Z","receivedAt":"2008-06-13T14:22:59Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Denis Bueno\" <dbueno@gmail.com> writes:\n\n> I'm on OS X 10.4.11 on Intel using git 1.5.5.3.\n> \n> I'd been trying to use the git-instaweb script (both with and without\n> arguments) with lighttpd (which I installed through Macports) without\n> success, seeing the following kind of bizarre error message:\n> \n>     funsat[290] > git instaweb\n>     /opt/local/bin/git-instaweb: line 6033: /usr/bin/env perl: No such\n> file or directory\n>     2008-06-13 09:09:31: (log.c.75) server started\n> \n>     funsat[291] > 2008-06-13 09:09:31: (mod_cgi.c.998) CGI failed:\n> Exec format error /Volumes/work/funsat/.git/gitweb/gitweb.cgi\n>     mod_cgi.c.1001: aborted\n>     2008-06-13 09:09:31: (mod_cgi.c.584) cgi died, pid: 23237\n> \n> \"/usr/bin/env perl: No such file or directory\"? Huh?  I certainly have\n> perl installed, so I don't know what that's about.\n> \n> That line simply calls perl by the $PERL variable, which is set at the\n> top of the script, like so:\n> \n>     PERL='/usr/bin/env perl'\n\nThis depends on how git was build (on compile time configuration).\ngit-instaweb.sh (source of git-instaweb) has\n\n        PERL='@@PERL@@'\n\nwhich is set to value of $PERL_PATH (or, to be more exact, its squoted\nversion) during building git-instaweb.  So you can simply use\n\n  $ make PERL_PATH=/usr/bin/perl\n  # make PERL_PATH=/usr/bin/perl install\n\nor whatever, or you can use ./configure script\n\n  $ make configure\n  $ ./configure --with-perl=/usr/bin/perl\n\n\nOn Linux for example the path to perl is set explicitely, instead of\nusing \"/usr/bin/env perl\" construct.  The 'env' construct has the\nfollowing disadvantages:\n - it uses first Perl find in your $PATH, so if git works for you or\n   don't work depends on user's personal configuration\n   (reproductability, convenience and security).\n - AFAIK it doesn't allow to pass switches to Perl\n\n\nP.S. Check if you have new enough Perl (there are problems with\nUnicode support in old Perl), and if you have CGI.pm new enough\ninstalled for gitweb.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"79723","messageId":"6dbd4d000806130739r633cb34cx9edbe48724d6a325@mail.gmail.com","threadId":"13931","inReplyTo":"20080613142118.GA20027@bit.office.eurotux.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Denis Bueno","fromEmail":"dbueno@gmail.com","sentAt":"2008-06-13T14:39:11Z","receivedAt":"2008-06-13T14:39:11Z","isPatch":false,"sender":{"key":"dbueno@gmail.com","avatar":"https://gravatar.com/avatar/591be06714161d33b59a485e6b822cbd40ecc0b91fd188b9924ea22c405996f7?d=mp&s=160"},"body":"On Fri, Jun 13, 2008 at 10:21, Luciano Rocha <luciano@eurotux.com> wrote:\n> Try changing the following line instead:\n>        \"$PERL\" -p -e \"$script\" \"$1.tmp\"  > \"$1\"\n> to\n>        $PERL -p -e \"$script\" \"$1.tmp\"  > \"$1\"\n>\n> about line 6121 of the git-instaweb script.\n\nThis is line 6033 for me; however, this change makes it work!  (I\nverified my changing this line; trying it; then changing it back to\nthe double-quotes version, and verifying it breaks.)\n\nWhy?\n\n-- \n Denis\n"},{"id":"79726","messageId":"48528769.2000007@isode.com","threadId":"13931","inReplyTo":"alpine.DEB.1.10.0806131016120.8043@alchemy.localdomain","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Chris Ridd","fromEmail":"chris.ridd@isode.com","sentAt":"2008-06-13T14:42:49Z","receivedAt":"2008-06-13T14:42:49Z","isPatch":false,"sender":{"key":"chris.ridd@isode.com","avatar":null},"body":"Asheesh Laroia wrote:\n> On Fri, 13 Jun 2008, Chris Ridd wrote:\n> \n>> Denis Bueno wrote:\n>>> On Fri, Jun 13, 2008 at 09:46, Asheesh Laroia <asheesh@asheesh.org> \n>>> wrote:\n>>>> Does OS X ship /usr/bin/env?\n>>>>\n>>>> If you type \"/usr/bin/env perl\" in a Terminal window, do you get Perl?\n>>>\n>>> Sorry, I should have made that clear earlier: yes.\n>>>\n>>> funsat[122] > /usr/bin/env perl --version\n>>>\n>>> This is perl, v5.8.8 built for darwin-2level\n>>\n>> MacPorts /tends/ to make ports use stuff from other ports instead of \n>> using Apple-installed bits. In this case, maybe git from MacPorts is \n>> using perl from MacPorts?\n> \n> FWIW, the problem seems to be that it's not finding *any* Perl.\n\nThat's odd, because the Portfile for git-core (1.5.5.3_0) does the \nbuild, test and destroot install setting:\n\nPERL_PATH=\"/usr/bin/env perl\" NO_FINK=1 NO_DARWIN_PORTS=1\n\n(and some other stuff). Have you pinged the port maintainer \n(bryan@larsen.st)?\n\nCheers,\n\nChris\n"},{"id":"79727","messageId":"6dbd4d000806130747r403cf637t66d59b58b9489e33@mail.gmail.com","threadId":"13931","inReplyTo":"48528769.2000007@isode.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Denis Bueno","fromEmail":"dbueno@gmail.com","sentAt":"2008-06-13T14:47:44Z","receivedAt":"2008-06-13T14:47:44Z","isPatch":false,"sender":{"key":"dbueno@gmail.com","avatar":"https://gravatar.com/avatar/591be06714161d33b59a485e6b822cbd40ecc0b91fd188b9924ea22c405996f7?d=mp&s=160"},"body":"On Fri, Jun 13, 2008 at 10:42, Chris Ridd <chris.ridd@isode.com> wrote:\n> Asheesh Laroia wrote:\n>>\n>> On Fri, 13 Jun 2008, Chris Ridd wrote:\n>>\n>>> Denis Bueno wrote:\n>>>>\n>>>> On Fri, Jun 13, 2008 at 09:46, Asheesh Laroia <asheesh@asheesh.org>\n>>>> wrote:\n>>>>>\n>>>>> Does OS X ship /usr/bin/env?\n>>>>>\n>>>>> If you type \"/usr/bin/env perl\" in a Terminal window, do you get Perl?\n>>>>\n>>>> Sorry, I should have made that clear earlier: yes.\n>>>>\n>>>> funsat[122] > /usr/bin/env perl --version\n>>>>\n>>>> This is perl, v5.8.8 built for darwin-2level\n>>>\n>>> MacPorts /tends/ to make ports use stuff from other ports instead of\n>>> using Apple-installed bits. In this case, maybe git from MacPorts is using\n>>> perl from MacPorts?\n>>\n>> FWIW, the problem seems to be that it's not finding *any* Perl.\n>\n> That's odd, because the Portfile for git-core (1.5.5.3_0) does the build,\n> test and destroot install setting:\n>\n> PERL_PATH=\"/usr/bin/env perl\" NO_FINK=1 NO_DARWIN_PORTS=1\n>\n> (and some other stuff). Have you pinged the port maintainer\n> (bryan@larsen.st)?\n\nThe issue seems to be one of the way bash is treating quotes.  It\napparently is trying to find the *command* \"/usr/bin/env perl\" and not\nexecuting the command \"/usr/bin/env\" with a first argument of \"perl\".\n\nSee my message to Luciano moments ago.\n\n-- \n Denis\n"},{"id":"79731","messageId":"20080613151307.GA21917@bit.office.eurotux.com","threadId":"13931","inReplyTo":"6dbd4d000806130739r633cb34cx9edbe48724d6a325@mail.gmail.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Luciano Rocha","fromEmail":"luciano@eurotux.com","sentAt":"2008-06-13T15:13:07Z","receivedAt":"2008-06-13T15:13:07Z","isPatch":false,"sender":{"key":"luciano@eurotux.com","avatar":null},"body":"On Fri, Jun 13, 2008 at 10:39:11AM -0400, Denis Bueno wrote:\n> On Fri, Jun 13, 2008 at 10:21, Luciano Rocha <luciano@eurotux.com> wrote:\n> > Try changing the following line instead:\n> >        \"$PERL\" -p -e \"$script\" \"$1.tmp\"  > \"$1\"\n> > to\n> >        $PERL -p -e \"$script\" \"$1.tmp\"  > \"$1\"\n> >\n> > about line 6121 of the git-instaweb script.\n> \n> This is line 6033 for me; however, this change makes it work!  (I\n> verified my changing this line; trying it; then changing it back to\n> the double-quotes version, and verifying it breaks.)\n> \n> Why?\n\n\"$PERL\" means the content of the variable is used as the command to\nexecute.\n\n$PERL, on the other hand, goes through a round of word splitting, that\nin your case results in the command \"/usr/bin/env\", with the arguments\n\"perl\", \"-p\", ...\n\nThus, if it is possible to use /usr/bin/env, the current \"$PERL\"\nincantation is incorrect.\n\n-- \nLuciano Rocha <luciano@eurotux.com>\nEurotux Informática, S.A. <http://www.eurotux.com/>\n"},{"id":"79732","messageId":"m363sdqrk0.fsf@localhost.localdomain","threadId":"13931","inReplyTo":"20080613151307.GA21917@bit.office.eurotux.com","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-13T15:32:20Z","receivedAt":"2008-06-13T15:32:20Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Luciano Rocha <luciano@eurotux.com> writes:\n> On Fri, Jun 13, 2008 at 10:39:11AM -0400, Denis Bueno wrote:\n>> On Fri, Jun 13, 2008 at 10:21, Luciano Rocha <luciano@eurotux.com> wrote:\n>>>\n>>> Try changing the following line instead:\n>>>        \"$PERL\" -p -e \"$script\" \"$1.tmp\" > \"$1\"\n>>> to\n>>>        $PERL -p -e \"$script\" \"$1.tmp\" > \"$1\"\n>>>\n>>> about line 6121 of the git-instaweb script.\n>> \n>> This is line 6033 for me; however, this change makes it work!  (I\n>> verified my changing this line; trying it; then changing it back to\n>> the double-quotes version, and verifying it breaks.)\n>> \n>> Why?\n> \n> \"$PERL\" means the content of the variable is used as the command to\n> execute.\n> \n> $PERL, on the other hand, goes through a round of word splitting, that\n> in your case results in the command \"/usr/bin/env\", with the arguments\n> \"perl\", \"-p\", ...\n> \n> Thus, if it is possible to use /usr/bin/env, the current \"$PERL\"\n> incantation is incorrect.\n\nThe problem is with trying to ensure that both\n\n   /path/with spaces/perl\n\nand\n\n   /usr/bin/env perl\n\nwork, as they require different rules wrt. splitting on whitespace...\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"79733","messageId":"20080613153913.GB21917@bit.office.eurotux.com","threadId":"13931","inReplyTo":"m363sdqrk0.fsf@localhost.localdomain","subject":"Re: git-instaweb portability issue (maybe?)","fromName":"Luciano Rocha","fromEmail":"luciano@eurotux.com","sentAt":"2008-06-13T15:39:13Z","receivedAt":"2008-06-13T15:39:13Z","isPatch":false,"sender":{"key":"luciano@eurotux.com","avatar":null},"body":"On Fri, Jun 13, 2008 at 08:32:20AM -0700, Jakub Narebski wrote:\n> Luciano Rocha <luciano@eurotux.com> writes:\n> > On Fri, Jun 13, 2008 at 10:39:11AM -0400, Denis Bueno wrote:\n> >> On Fri, Jun 13, 2008 at 10:21, Luciano Rocha <luciano@eurotux.com> wrote:\n> >>>\n> >>> Try changing the following line instead:\n> >>>        \"$PERL\" -p -e \"$script\" \"$1.tmp\" > \"$1\"\n> >>> to\n> >>>        $PERL -p -e \"$script\" \"$1.tmp\" > \"$1\"\n> >>>\n> >>> about line 6121 of the git-instaweb script.\n> >> \n> >> This is line 6033 for me; however, this change makes it work!  (I\n> >> verified my changing this line; trying it; then changing it back to\n> >> the double-quotes version, and verifying it breaks.)\n> >> \n> >> Why?\n> > \n> > \"$PERL\" means the content of the variable is used as the command to\n> > execute.\n> > \n> > $PERL, on the other hand, goes through a round of word splitting, that\n> > in your case results in the command \"/usr/bin/env\", with the arguments\n> > \"perl\", \"-p\", ...\n> > \n> > Thus, if it is possible to use /usr/bin/env, the current \"$PERL\"\n> > incantation is incorrect.\n> \n> The problem is with trying to ensure that both\n> \n>    /path/with spaces/perl\n> \n> and\n> \n>    /usr/bin/env perl\n> \n> work, as they require different rules wrt. splitting on whitespace...\n\nOh. Then it gets ugly. Can't just \"perl\" be used? Instead of\n\"/usr/bin/env perl\"?\n\nOtherwise...\nif [ -x \"$PERL\" ]; then\n\t\"$PERL\" ...\nelse\n\t$PERL ...\nfi\n\n-- \nLuciano Rocha <luciano@eurotux.com>\nEurotux Informática, S.A. <http://www.eurotux.com/>\n"}]}