while ( @array ) { ... } # or print "Array is empty\n" if ! @array;