in reply to Re: comparing arrays
in thread comparing arrays
I cant say that I exactly understand what that code does, but I will figure it out somehow. I understand the grep and !defined part, but not the %array1=map... and $array1{$_}. But I'll read up on it, I refuse to use code that I do not understand, even if it works.my %array1=map{$_ =>1} @array1; my %array2=map{$_=>1} @array2; my @differences=grep(!defined $array1{$_}, @array2); foreach $difference (@differences) { $differences++; print "$difference \n"; }
|
|---|