if ($$self{hop_array} && !(@{$$self{hop_array}})) {

works for me.  Please confirm that the test performs the same function as the original line.