作者chadtracy (无名)
看板perl
标题[请益] 请教pod的使用
时间Tue Sep 26 23:33:25 2006
新手上路,请各位高手莫见怪。
下面是自己参考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)