<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ivaneeo's blog

    自由的力量,自由的生活。

      BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
      669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks
    文檔選項(xiàng)
    將此頁作為電子郵件發(fā)送

    將此頁作為電子郵件發(fā)送

    未顯示需要 JavaScript 的文檔選項(xiàng)


    最新推薦

    Java 應(yīng)用開發(fā)源動(dòng)力 - 下載免費(fèi)軟件,快速啟動(dòng)開發(fā)


    用傳統(tǒng)的 Unix 方式創(chuàng)建的簡(jiǎn)單用戶界面

    Unix 用戶非常熟悉基于文本的 UI 模型。設(shè)想有一個(gè) Perl 程序,讓我們先看一下這個(gè)模型用于該程序的簡(jiǎn)單實(shí)現(xiàn)。標(biāo)準(zhǔn)的 Getopt::Std 模塊簡(jiǎn)化了命令行參數(shù)的解析。這個(gè)程序僅僅為了說明 Getopt::Std 模塊(沒有實(shí)際用途)。 請(qǐng)參閱本文后面的參考資料。

    使用 Getopt::Std 的命令行開關(guān)
    				
    						
    #!/usr/bin/perl -w

    use strict; # always use strict, it's a good habit
    use Getopt::Std; # see "perldoc Getopt::Std"

    my %options;
    getopts('f:hl', \%options); # read the options with getopts

    # uncomment the following two lines to see what the options hash contains
    #use Data::Dumper;
    #print Dumper \%options;

    $options{h} && usage(); # the -h switch

    # use the -f switch, if it's given, or use a default configuration filename
    my $config_file = $options{f} || 'first.conf';

    print "Configuration file is $config_file\n";

    # check for the -l switch
    if ($options{l})
    {
    system('/bin/ls -l');
    }
    else
    {
    system('/bin/ls');
    }

    # print out the help and exit
    sub usage
    {
    print <<EOHIPPUS;
    first.pl [-l] [-h] [-f FILENAME]

    Lists the files in the current directory, using either /bin/ls or
    /bin/ls -l. The -f switch selects a different configuration file.
    The -h switch prints this help.
    EOHIPPUS
    exit;
    }
    posted on 2006-04-18 10:34 ivaneeo 閱讀(749) 評(píng)論(0)  編輯  收藏 所屬分類: perl-殺雞就要用牛刀
    主站蜘蛛池模板: 亚洲欧洲精品在线| 久久久久久久亚洲Av无码| 亚洲综合激情五月色一区| 久久国产色AV免费观看| 国产亚洲精品一品区99热| 国产日韩在线视频免费播放| 亚洲AV中文无码乱人伦在线视色| 美女视频黄.免费网址| 四虎影视免费永久在线观看| 国产亚洲视频在线播放大全| 亚洲欧洲日产国码一级毛片| 精品国产福利尤物免费| 亚洲国产美女精品久久久久∴| a级毛片免费完整视频| 亚洲AV成人精品网站在线播放| 无码少妇精品一区二区免费动态| 亚洲永久永久永久永久永久精品| 黄在线观看www免费看| 国产精品亚洲精品| 精品免费国产一区二区| 国产成人不卡亚洲精品91| 亚洲国产精品成人久久蜜臀| a级片免费在线观看| 91亚洲一区二区在线观看不卡 | 成人无码区免费A∨直播| 日韩va亚洲va欧洲va国产| 性无码免费一区二区三区在线| 亚洲国产精品线观看不卡| 成人免费视频国产| 国产成人精品免费大全| 久久久久亚洲AV无码专区体验| 91免费资源网站入口| 黄色毛片免费网站| 亚洲AV无码精品色午夜果冻不卡 | 亚洲a在线视频视频| 100000免费啪啪18免进| 美女被艹免费视频| 亚洲成AV人片在线观看| 日韩免费a级毛片无码a∨| 一级做a爰片久久毛片免费陪| 亚洲成在人天堂在线|