in reply to Parsing/Evaluating a prefix-notation equation using sexeger
sub my_epe { my ($s,$h) = @_; my $op = '(' . join('|', keys %$h) . ')'; my $con = qr/Con (\d+(?:\.\d+)?)/; 1 while $s=~s/$op \s+ $con \s+ $con/'Con '.$h->{$1}($2,$3)/ex; $s; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing/Evaluating a prefix-notation equation using sexeger
by jryan (Vicar) on Sep 01, 2004 at 22:38 UTC |