用户:
sdfjusdf查看:0 回复:1 评论:0 创建时间:2020-02-19T21:54:55
#! /usr/bin/perl
use v5.14.0;
use utf8;
use Tkx;
my $ip;
my $ipRef = \$ip;
my $text;
my $textRef = \$text;
my $tk = Tkx::widget->new(".");
$tk->new_ttk__label(-text=>"IP:")->g_pack();
my $ipEntry = $tk->new_ttk__entry(-textvariable=>\$ip)->g_pack();
$tk->new_ttk__label(-text=>"Sh")->g_pack();
my $shEntry = $tk->new_ttk__entry(-textvariable=>\$text)->g_pack();
my $btnIpSet = $tk->new_ttk__button(-text=>"ip settle",-command=>sub{ open(FOUT,"|-","ssh $$ipRef"); })->g_pack();
my $btnRun = $tk->new_ttk__button(-text=>"run",-command=>sub{ print (FOUT $$textRef); })->g_pack();
my $btnDone = $tk->new_ttk__button(-text=>"done writing",-command=>sub{ print close(FOUT); })->g_pack();
Tkx::MainLoop();
__END__
这是perl代码,C++和它比较像,我就用了C++的代码框