sub CompareImage{ print " CompareImage function called"; my @args = @{$_[0]}; print "Arguments:".@args[0]; print "Arguments:".@args[1]; my($cmp) = Image::Compare->new(); $cmp->set_image1( img => '@args[0]', ); $cmp->set_image2( img => '@args[1]', ); $cmp->set_method( method => &Image::Compare::THRESHOLD, args => 25, ); if ($cmp->compare()) { print 'The images are the same, within the threshold'; return 'PASS'; } else { print 'The images differ beyond the threshold'; return 'FAIL'; } }