求样例啊求样例
my $stdout; { local *STDOUT; open STDOUT,'>:scalar', \$stdout; print 'hello world'; }; print "content of stdout is " . $stdout . "\n";
输出:
content of stdout is hello world
标签
查看
211 次