I know I could have made this neater by using $_, but he probably has the value in some variable.use strict; use warnings; my $str = 'char(123)+char(107)+char(112)+char(43)'; $str =~ tr/+/ /; $str =~ s/char\((\d+)\)/chr($1)/eg; print $str;
In reply to Re: parsing and evaluating a string
by TedPride
in thread parsing and evaluating a string
by bfdi533
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |