my $fractionValue = ( $str =~ m{^(\d+)/([1-9]\d*)} ) # regex match will evaluate to true or false ? # the "ternary operator" -- if above condition is true, then... $1/$2 # return this value (using the 1st and 2nd matched digit strings : # otherwise (if above condition was false), ... "undefined" # return this value ; # end of statement