[請益] 請教pod的使用

看板Perl作者 (無名)時間17年前 (2006/09/26 23:29), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
新手上路,請各位高手莫見怪。 下面是自己參考pod的範例改出來的程式,可是在寫的時候發現一個問題 如果我執行的時候沒有把exec的那行mark掉 用參數-e 可以執行我要的東西,用參數-h看help的話就沒辦法看到help 想請問各位先進要怎麼解決比較好? use Pod::Usage; use Getopt::Long; my %options; $options{sentence} = 0; Getopt::Long::config ('bundling'); GetOptions (\%options, 'help|h', 'exe|e=s', \@ex) or exit 1; #read exec array print "foo: @ex[0] \n"; print "foo: @ex[1] \n"; exec("@ex[0]"); pod2usage (1) if $options{help}; =head1 NAME att - ATT =head1 SYNOPSIS =head1 DESCRIPTION # -f <file> open/write configuration file -s realtime status ex: CPU Usage, Mem Usage, Job ID Alive? -e <command> "Commands or shell script" -l log status -t test times -h help =head1 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.224.50.122 ※ 編輯: chadtracy 來自: 61.224.50.122 (09/26 23:34)
文章代碼(AID): #156KTSoZ (Perl)