in reply to Re^2: Regular Expression Help!
in thread Regular Expression Help!

I think this will do it:
if ( ($var =~ /^\s+$/) or ($var eq "") ){ print "\n All \n"; }else{ print "\n Nothing \n"; }

Replies are listed 'Best First'.
Re^4: Regular Expression Help!
by marinersk (Priest) on Jul 02, 2010 at 21:14 UTC
    I don't understand why you won't just use:
    if ($var =~ /^\s*$/) { # Do blank procedure } else { # Do nonblank procedure }
      I was reading on this posting and found an interesting regular expression, can someone explain what is happening here?

      if ($var =~ /^\s*$/)


      Thanks!