Re: making a variable execute

2003-10-18 Thread Randal L. Schwartz
> "perl" == perl <[EMAIL PROTECTED]> writes: perl> Can someone show me how to make this compute? perl> my $a=2; perl> my $b=3; perl> my $oper="+"; perl> my $c = $a $oper $b; perl> where $c would have a value of 5. A lot faster and safer than the "eval" solution: my %ops = ( "+" => sub {

RE: making a variable execute

2003-10-17 Thread perl
thanks >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> Sent: Friday, October 17, 2003 3:54 PM >> To: [EMAIL PROTECTED] >> Subject: making a variable execute >> >> >> Can someone show me how to make this compute? >> >> my $a=2; >> my $b=3; >> my $oper="+"; >>

RE: making a variable execute

2003-10-17 Thread LoBue, Mark
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday, October 17, 2003 3:54 PM > To: [EMAIL PROTECTED] > Subject: making a variable execute > > > Can someone show me how to make this compute? > > my $a=2; > my $b=3; > my $oper="+"; > > my $c = $a $oper