my $fractionValue = ( $str =~ m{^(\d+)/([1-9]\d*)} ) ? $1/$2 : "undefined";
wow..it seems to work. But i've always got some problem understanding regex.. if you don't mind explaining it to me how it works?
1. =~ = (doesn't this means.."not equal to"?)
2. m{ } = (no idea)
3. $1/$2 = (I never knew you could do things like that after a one line condition? What does it actually do?)