if ($data =~ /^\s*$/) { ..do this...} else{ ..that...} [download]
In reply to Explaining a Regular Expression by Anonymous Monk