$hi = do_this('asdf');
sub do_this
{
$blob{'f'} = {
'k' => 'j'
};
}
print $hi->{'k'};
# prints j
Run Code Online (Sandbox Code Playgroud)
因为do_this没有返回任何东西,它怎么还打印j?
Jim*_*son 25
http://perldoc.perl.org/functions/return.html
在没有显式返回的情况下,子例程,eval或do FILE会自动返回最后一个表达式的值