in reply to Parsing/Evaluating a prefix-notation equation using sexeger

Why do you consider sexeger preferable to ordinary regexes for this?
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; }

Caution: Contents may have been coded under pressure.

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

    That's a really good point. :) I guess I saw that sexeger might be applicable, got excited, and just flew with it. A huge ++ for bringing me back down to earth.