簡體   English   中英

Perl / Tk系統功能錯誤?

[英]Perl/Tk System Function Error?

我正在做一個“多合一計算器”(我想)。 這是我的代碼(我知道我沒有定義所有子程序,我仍在研究這個,你可以看到):

use 5.12.4;
use warnings;
use Tk;

##### Create MainWindow #####
my $button_menu = new MainWindow;
#############################

##### MainWindow Buttons#####
my $calculator_button = $button_menu->Button(-text=>"Calculator",
                                         -width=>10,
                                         -relief=> 'raised',
                                         -command=>\&open_calculator)->pack();

my $formulas_button = $button_menu->Button(-text=>"Formulas",
                                   -width=>10,
                                   -relief=> 'raised',
                                   -command=>\&open_formulas)->pack();


sub open_calculator{
    system(qq{start "C:\\Windows\\system32\\calc.exe"});
}

MainLoop;

為什么系統功能無法打開Windows計算器?

謝謝!

嘗試這個:

system(qq{start calc});
system('start C:\Windows\system32\calc.exe');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM