My question is why perl do not support chr('0b'.$1)Because chr takes a number as an argument. You pass it a string - a string that doesn't look like a number. The "0b" only works for numeric literals, or arguments to oct and hex. '0b' . $1 is not a literal.
Is there a way to convert a string to number explicitly like perl6?eval, as in
$string =~ s/ (\d+)/chr eval "0b$1"/egx;
In reply to Re: what is difference between chr and oct?
by JavaFan
in thread what is difference between chr and oct?
by xiaoyafeng
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |