in reply to passing data to variable in if statment

Are you sure WIND_GUST_MPH contains the empty string and not undef? In either case, you can use
if ($gust) { $gusting ="gusting to $gust"; } else { $gusting ="not gusting"; }


Unless I state otherwise, all my code runs with strict and warnings

Replies are listed 'Best First'.
Re^2: passing data to variable in if statment
by stuffy (Monk) on May 06, 2008 at 21:13 UTC
    You are correct, it is not an empty string. Your fix did the trick. I thought about switching it around, but I thought that what I had was correct, and would have been if an empty string was being passed. Thank you for your help.


    Stuffy
    That's my story, and I'm sticking to it, unless I'm wrong in which case I will probably change it ;~)
    may be reproduced under the SDL