in reply to parsing and evaluating a string
What is the correct sum of the following characters?
{ 123
k 107
p 112
* 42
+
-----
???
They don't really add in a numeric sense.
What is the bigger picture here? What are you trying to accomplish?
At least the parsing part shouldn't be too difficult:
my $string = "char(123)+char(107)+char(112)+char(42)"; my @characters = map{ chr $_ } $string =~ m/(\d+)/g; print "$_\n" foreach @characters;
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: parsing and evaluating a string
by bfdi533 (Friar) on Apr 24, 2006 at 12:52 UTC | |
by davido (Cardinal) on Apr 24, 2006 at 15:15 UTC |