perl 文件句柄

来源:互联网 发布:cad迷你看图 mac 编辑:程序博客网 时间:2024/05/01 19:07
#!/usr/bin/perl

use autodie;

open LOG, '>>', 'log_file';
print LOG "first log input\n";
close LOG;

open LOG, '>>', 'log_file';
print LOG "second log input\n";
close LOG;

$| = 1;  #使得当前的文件句柄输出立即显示在屏幕上
select STDOUT;
print "sadafd";

open LOG, '>>', 'log_file';
print LOG "dsadadsf";
close LOG;
0 0