Hi there, I'm trying to understand interpolation of operators within strings. Specifically, can mathematical operators be interpolated within strings and evaluated as operators. Below is some example code to make my question clear. Many thanks!
my @ops = ( '-', '+', '*', '/' ); for( @ops ) { my $a = "2 $_ 2"; say $a; }
Is it possible iterate over these operations and perform calculations?
In reply to interpolating operators within strings by abualiga
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |