preload
十月 28

Hello World

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env perl
 
# helloworld.pl
#
# Created by Chun-Ting Liu on 2009-10-28
 
require 5.008008;
use warnings;
use strict;
use Tk;
my $mw = MainWindow->new;	#建立一個視窗
$mw->title("Hello World");	#改變視窗標題文字,若沒有指定則預設為檔名(首字母會自動大寫)。title method不是必要的但會比較好看。
$mw->Button(-text => "Done!",
	-command => sub { exit })->pack();
	#建立一個寫著Done!的Button widget,點擊後則執行 exit。
MainLoop;	#開始GUI事件處理

Hello World

溫故知新

載入中…

相關文章:

Tagged with:

2 Responses to “[Perl/Tk] 學習筆記 1: Hello World”

  1. 逸冰博客 CHINA Internet Explorer Says:

    大家有时间多交流,记得回访哦,如果可以交换下链接.

  2. ㄚ琪 TAIWAN Mozilla Firefox Windows Says:

    Chun感謝您來工作達人留言!
    最近翻了Larry Wall的一篇Programming is Hard, Let’s Go Scripting…在寫程式難,就讓我們寫指令碼吧…
    感覺是在推崇Perl 6吧!不過覺得有點難翻,有空來幫忙看一下吧!
    Thanks!

Leave a Reply