open my $fh, '<', 'C:\ppp.txt', or die "Could not open file $!"; if ($fh contains an empty file) { // then add this the $address in the ppp.txt's first line }