解释这段代码的输出? (哈希)

时间:2018-03-05 23:40:30

标签: perl

const mapDispatchToProps = dispatch => ({
  savePost: dispatch(savePost())
});

export default connect(undefined, mapDispatchToProps)(AddPost);

上述代码的输出是:

#!/usr/bin/perl
use strict;
use warnings;
my (%finish_line,
$position,
$finish_line,
%finishers,
%both,
$both);

%finish_line=(2=>'LeAnne',4=>'Masur',3=>'Chan',1=>'Mark');
%finishers=(6=>'Jose',5=>'Carey');
%both=(%finish_line,%finishers);

foreach $position (sort{$both{$a} cmp $both {$b}}keys %both)
{
print "$both{$position} was $position.\n";
}
print %both;

我真的不明白整个输出背后的逻辑 有人可以解释一下吗?

0 个答案:

没有答案