# in scalar context an array # will return the number of its elements print scalar @lines; #which leads to if (scalar @lines) { #array is not (an) empty (list) ... }