摘要: 1)文件读取的3中方法按行读,存入标量while (<FILE>) { print; }按行读,存入数组@array = <FILE>;读入整个文件 ,存入标量$string = do { local $/; <FILE>; };2)读文件实例open (EP,"/etc/passwd");while (<EP>) {chomp;print "I saw $_ in the password file!\n";}3)读写文件实例open(IN,$a) || die "cannot open $a 阅读全文
posted @ 2012-10-26 11:31 iTech 阅读(2961) 评论(0) 推荐(0) 编辑