2009/1/23 kind terry <[email protected]>: > > eval "system('rm -rf /')" > 和 > eval { > system('rm -rf /'); > } > > 有什么不同? >
eval "string" 这种不会在编译时检查 string 是否有语法问题,而 eval block 这种就会。 而且后一种形式,block 的代码只编译一次,但 eval string 中的代码每次执行到都会 重新解析编译 string。 详见 eval in perlfunc lee --~--~---------~--~----~------------~-------~--~----~ 您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。 要在此论坛发帖,请发电子邮件到 [email protected] 要退订此论坛,请发邮件至 [email protected] 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛 -~----------~----~----~----~------~----~------~--~---
