open( HANDLE, "list.txt" ) or die "Cannot open file - $!"; while( ) { # Process file line by line here } close HANDLE;