@array will return the number of elements in the array. If the array is empty then @array will return 0 not the empty value. Hence @array eq "" will not work for checking empty array.
So reform the perl code as
if(@array==0) { print "TEST1 passes\n"; }