內容

名稱

ExtUtils::Command::MM - MM 在 Makefiles 中使用的指令

語法

perl "-MExtUtils::Command::MM" -e "function" "--" arguments...

說明

僅供內部使用!介面不穩定。

ExtUtils::Command::MM 封裝了原本必須使用大型「單行」指令才能執行的程式碼。

範例中使用的任何 $(FOO) 都是 make 變數,而非 Perl。

test_harness
test_harness($verbose, @test_libs);

透過 Test::Harness 執行 @ARGV 上的測試,傳遞 $verbose 旗標。任何 @test_libs 都會移到測試的 @INC 前面。

@test_libs 會按字母順序執行。

pod2man
pod2man( '--option=value',
         $podfile1 => $manpage1,
         $podfile2 => $manpage2,
         ...
       );

# or args on @ARGV

pod2man() 是一個執行 pod2man 程式大部分任務的函數。它的參數與 5.8.0 的 pod2man 完全相同,但增加了

--perm_rw   octal permission to set the resulting manpage to

並移除了

--verbose/-v
--help/-h

如果沒有提供參數給 pod2man,它會從 @ARGV 讀取。

如果 Pod::Man 無法使用,這個函數會發出警告並傳回 undef。

warn_if_old_packlist
perl "-MExtUtils::Command::MM" -e warn_if_old_packlist <somefile>

顯示已找到舊的 packlist 檔案的警告。從 @ARGV 讀取檔案名稱。

perllocal_install
perl "-MExtUtils::Command::MM" -e perllocal_install
    <type> <module name> <key> <value> ...

# VMS only, key|value pairs come on STDIN
perl "-MExtUtils::Command::MM" -e perllocal_install
    <type> <module name> < <key>|<value> ...

列印一段適合附加到 perllocal.pod 的 POD 程式碼片段。參數從 @ARGV 讀取。

'type' 是您正在安裝的內容的類型。通常是 'Module'。

'module name' 只是您的模組的名稱。(Foo::Bar)

金鑰/值對是關於模組的額外資訊。欄位包括

installed into      which directory your module was out into
LINKTYPE            dynamic or static linking
VERSION             module version number
EXE_FILES           any executables installed in a space separated
                    list
uninstall
perl "-MExtUtils::Command::MM" -e uninstall <packlist>

ExtUtils::Install::uninstall() 的包裝器。警告解除安裝已不建議使用,且不會實際執行解除安裝。

test_s
perl "-MExtUtils::Command::MM" -e test_s <file>

測試檔案是否存在且不為空 (大小 > 0)。如果存在,則以 0 退出,如果不存在,則以 1 退出。

cp_nonempty
perl "-MExtUtils::Command::MM" -e cp_nonempty <srcfile> <dstfile> <perm>

測試來源檔案是否存在且不為空 (大小 > 0)。如果它不為空,則使用指定的權限將它複製到指定的目的地。