문제

The CGI scripts and tools that comprise movabletype have the perl binary name hard-coded

#!/usr/bin/perl -w

Unless I manually replace all these instances with

#!/usr/bin/env perl
use warnings;

it seems impossible to run movabletype under my private version of perl (installed with perlbrew). Is there some way I can run movabletype under the perlbrew perl without making these changes manually?

도움이 되었습니까?

해결책

... write a program to change them for you?

#! /usr/bin/env perl
use common::sense;
use Tie::File;

tie my @f, 'Tie::File', shift or die $!;
if ($f[0] =~ m,#! */usr/bin/perl( -w)?,) {
  $f[0] = '#! /usr/bin/env perl';
  splice @f, 1, 0, 'use warnings;' if $1
}
untie @f;

Somethin' like.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top