原来是这样的
2010/7/20 cnhack TNT <[email protected]> > > my $stdout = open OLDOUT, ">&STDOUT" or die $!; > open STDOUT, ">/dev/null" or die $!; > print "You can not see me~\n"; > select OLDOUT; > print "Now you\'ve got me!\n"; > > > > 2010/7/17 Michael Zeng <[email protected]> > > select 不行么, 光用select >> >> 2010/7/17 woosley. xu. <[email protected]> >> >> 先open /dev/null >>> >>> 在 2010年7月17日 上午8:16,Michael Zeng <[email protected]>写道: >>> >>>> tcl 里面可以 redirect > /dev/null , >>>> 然后所有puts 都不会往Stdout输出 >>>> >>>> perl里面怎么玩 >>>> >>>> select /dev/null >>>> select STDERR >>>> >>>> print "haha\n" 都不行啊, >>>> >>>> 就是想控制下print输出的 句柄,再不写显式的句柄的情况下 >>>> >>>> >>>> >>>> >>>> -- >>>> Yours Sincerely >>>> Zeng Hong >>>> >>>> -- >>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 >>>> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 >>>> 要取消订阅此网上论坛,请发送电子邮件至 >>>> [email protected]<perlchina%[email protected]> >>>> 。 >>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 >>>> >>> >>> >>> >>> -- >>> Woosley.Xu >>> >>> >>> >>> >>> -- >>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 >>> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 >>> 要取消订阅此网上论坛,请发送电子邮件至 >>> [email protected]<perlchina%[email protected]> >>> 。 >>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 >>> >> >> >> >> -- >> Yours Sincerely >> Zeng Hong >> >> -- >> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 >> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 >> 要取消订阅此网上论坛,请发送电子邮件至 >> [email protected]<perlchina%[email protected]> >> 。 >> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 >> > > -- > 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 > 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 > 要取消订阅此网上论坛,请发送电子邮件至 > [email protected]<perlchina%[email protected]> > 。 > 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 > -- Yours Sincerely Zeng Hong -- 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
