Posterous

various ramblings

-- justin kelly

  • Blog
  • Home
  • Contact me
« Back to posts
  • Viewed
    times

Filed under

  • perl
October 5, 2009

Perl: how check if variable is empty

  • Edit
  • Delete
  • Tags
  • Autopost
Need a Perl equivilant of PHPs empty()

Purpose: Check is $value is empty

if( $value  =~ /^\s*$/)
{
  #...
}

Purpose: Check is $value is not empty

if( $value  !~ /^\s*$/ )
 {
  #...
}