0
让我们说,我有以下DIFF与单独添加和删除部分数据结构
my $clean = {
foo => 1,
bar => 2,
baz => 3,
};
my $dirty => {
foo => 1,
bar => 3,
blargh => 4,
};
my $differ = Differ->new; #made up object
$differ->compare($clean, $dirty);
$differ->added; # blargh
$differ->removed; # baz
$differ->updated; # bar
以上,也许是什么I'my试图做(一个非常新颖的例子,我的收益可能不足够复杂)。有没有可以为我做这个的模块?
我基本上试图找出如何计算通过改变发送到远程服务器的内容。模块理论上应该能够处理包括阵列在内的复杂数据结构(不需要自引用)
参见:http://stackoverflow.com/questions/4011632/perl-need-to-compare-two-data-structures-and-返回差异 – xxfelixxx
您的示例代码中存在拼写错误。 '我的$脏=> {'应该'我的$脏= {'。 – Kaoru