www
groad
#!/usr/bin/perl
open TEMP, ">>temp.txt";
select TEMP; #使标准输出改变到 TEMP
print "hello perl world.\n";
print "perl is very powerfull.\n";
select STDOUT; #又切换为标准输出
print "i am leaving select.\n";
# ./select.pl
i am leaving select.
# cat temp.txt
www
groad
hello perl world.
perl is very powerfull.
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |