in reply to Help with loops
which basically matches all the fractions and substitute them by themselves evaluated (The numeric value)while (<DATA>) { s!\d+/\d+!$&!gee; print; } __DATA__ SYMM 1/8 - X, 1/8 + Y, 1/8 + Z SYMM 1/6 - X, 1/6 + Y, 1/6 + Z SYMM 1/4 - X, 1/4 + Y, 1/4 + Z
$_=$,=q,\,@4O,,s,^$,$\,,s,s,^,b9,s, $_^=q,$\^-]!,,print
|
|---|