Hi folks,
I have a seemingly simple problem, but I can't find a satisfying
solution. I have a function which tests to see if a value represents
what I want to call "true". Here's a simplified version:
if ($val =~ /true/i || $val =~ /t/i || $val != 0) { return 1; } else
{ return 0; }
The text might be numeric or not. If it is numeric, I want to accept
anything but zero as true. But, if I run this on a textual non-true
value, such as "false", I get:
Argument "false" isn't numeric in numeric ne (!=) at ...
The code works, but I don't want to get the warning (I'm using
'warnings'). So, how can I test to see if it's a numeric value, before
I try to use it as one? I tried using int() to convert it, but that
gives the same warning.
Any ideas? Thanks.
--
Lyle Kopnicky
Software Project Engineer
Veicon Technology, Inc.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs