use strict; use warnings; my $str = "char(123)+char(107)+char(112)+char(43)"; my $newStr; () = $str =~ m|(\d+)(?{$newStr .= chr($1)})|g; print "$newStr\n";
When run this produces
{kp*
Cheers,
JohnGG
In reply to Re: parsing and evaluating a string
by johngg
in thread parsing and evaluating a string
by bfdi533
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |