Peter,

Take a look at eval.


> -----Original Message-----
> From: Peter Eisengrein [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 06, 2001 2:20 PM
> To: Perl-Win32-Users Mailing List (E-mail)
> Subject: operator help
> 
> 
> I'm trying to allow the user to select an operator from an @array to
> determine if something should be done and I can't seem to 
> figure out how to
> do it. Consider:
> 
> 
> @operators = ("\<","\<\=","\=","\!\=","\>\=","\>");  
> ### lets say user chose $operators[0] (<) and it is now 
> stored in $fOp1
> 
> if ($fromTime $fOp1 $fTime);
> {
>       &something();
> }
> 
> 
> 
> Basically, I want to know 'if $fromTime is less than $fTime' then do
> &something(). However, I can't figure out how to expand $fOp1 
> before the
> other two vars and therefore have it act as the operator. 
> Normal precedence
> (i.e. parenthesis, quotes, etc) doesn't seem to work.
> 
> Any ideas?
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
> 
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to