@var= 读取文件内容,会将空行过滤掉。
1.
if (open(FILE,"c:/users/hp/desktop/test.xml") )
{
print "the contents list below\n";
>;
#print @contents[1];
while()
{
chmop;
print "$_\n";
}
close(FILE);
}
打印的结果为:
the contents list below
2.
if (open(FILE,"c:/users/hp/desktop/test.xml") )
{
print "the contents list below\n";
@contents=;
print @contents;
close(FILE);
}
打印结果:
the contents list below
阅读(1382) | 评论(0) | 转发(0) |