open (IN, "< $file") or warn ("Can't open $file: $!\n"), die; while () { # loop through the file, print ("$file ==> $_"); # read one line at a time } close(IN);