----- Original Message ----- From: "Mr. Nobody" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 03, 2003 1:58 PM Subject: Re: "my int( 1..31 ) $var" ?
> --- Smylers <[EMAIL PROTECTED]> wrote: > > Murat Ünalan wrote: > > > > > print "date" if $var is int( 1..31 ); > > > > I don't think that the type needs to be specified here, especially if > > the variable has already been declared to be of the required type, so a > > junction should be sufficient: > > > > print "date" if $var == any(1 .. 31); > > > > Smylers > > Superpositions in the core? You're kidding, right? > > What's wrong with "if 1 <= $var <= 31"? > For one thing they're not equivalent. my $var = 2.5; print "date" if $var == any(1..31); print "in interval" if 1 <= $var <= 31; Speaking of which, is there a run-time test to check if a variable is of integral type? Something like print "date" if ($var is int) && (1 <= $var <= 31); Joe Gottman