作者s1106 (big john)
看板Perl
标题[问题] 开档问题
时间Sat Oct 24 10:03:04 2009
新手问题~
#check read file is ok
unless (open(INFILE, "/var/log/123.txt")) {
die ("cannot open file");
请问一下如果开档失败,要如何把路径档名显示在萤幕上让user知道
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 192.156.198.62
1F:推 godman362:把档名当成参数纪录,当错误的时候用参数显示 10/24 12:32
2F:→ godman362:这样的方法觉得如何? 10/24 12:32
3F:推 yanganto:open(INFILE, $file) || die "cannot open $file\a\n" 10/24 16:21
4F:→ s1106:还可以这样用啊~感恩~ 10/25 23:21