----- Original Message -----
From: "Uri Guttman" <[EMAIL PROTECTED]>
To: "Joe Gottman" <[EMAIL PROTECTED]>
Cc: "Perl6" <[EMAIL PROTECTED]>
Sent: Friday, January 03, 2003 10:06 PM
Subject: Re: "my int( 1..31 ) $var" ?


> >>>>> "JG" == Joe Gottman <[EMAIL PROTECTED]> writes:
>
>   JG>   Speaking of which, is there a run-time test to check if a variable
is of
>   JG>  integral type?  Something like
>
>   JG>  print "date" if ($var is int) && (1 <= $var <= 31);
>
> the old standby is:
>
> int( $var ) == $var
>

   I'm not sure if this works.

my $var = "0";  # Notice the quotation marks
print "is integer" if (int($var) == $var);

In the above case int($var) == $var returns true when I would want it to
return false.

Joe Gottman


Reply via email to