if (@file != 0) {# @file in scalar context here - returns number of lines in the array #your stuff here };