while ($requests = ) { chomp $requests; #remove any endline characters #if all endline characters are wiped, #check for nothingness if ($requests ne "") { # add newline for lines we're printing print MAIL "$requests\n"; } }