< Previous (8/14) | [Index] | Next (10/14)>
my @array1 = qw(a b 5); my @array2 = qw(a b 6); if (compare_arrays(\@array1,\@array2)) { print "Same!\n"; } else { print "Different!\n"; } sub compare_arrays { my %count; my @first_array = @{$_[0]}; my @second_array = @{$_[1]}; for (@first_array,@second_array){++$count{$_}} for (values %count) {return 0 if ($_ ne 2)} return 1; }
Offer Kaye. YAPC::Israel::2005.
Slides automatically generated by tmpl2slides.pl. Last updated on Wed Feb 9 23:11:09 2005