in reply to Help with loops

If I understand what you want, you just want to evaluate the fractions in each line as decimals, ignoring the "-x", "+Y" etc. Well, this does what you want:
while (<DATA>) { @fractions = m!(\d+/\d+)!g; print eval($_), " " foreach @fractions; print "\n"; } __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 SYMM 1/2 - X, 1/2 + Y, 1/2 + Z
This code takes advantage of the fact that the "match" operator (m//) provides an array of every match when used with the /g modifier. Doing it this way lets us dispense with all those messy splits. The "eval" command tells Perl to actually "do the math" with the resulting fractions, printing (for example) "0.5" rather than just the string "1/2".

Your next question might be on how round the resulting fractions accordingly. For that, I point you to perfunc and the sprintf function.

Enjoy!

Gary Blackburn
Trained Killer