只是感兴趣:有没有办法在下面的代码片段中做第二种形式的Dumper?
use Modern::Perl;
use Data::Dumper::Simple;
my $data = { name => 'jim', age => 21, updated => time() };
my $timestr = localtime($data->{updated});
say Dumper($data->{updated}, $timestr);
# output:
# $data->{updated} = 1338537112;
# $timestr = 'Fri Jun 1 08:51:52 2012';
say Dumper($data->{updated}, scalar localtime($data->{updated} ));
# compiliation error:
# say (...) interpreted as function at c:\temp\test4.pl line 9.
# syntax error at c:\temp\test4.pl line 9, near "}]"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
941 次 |
| 最近记录: |