Help for this page

Select Code to Download


  1. or download this
    $str = fraction($str) if ($str =~ /\d+_\d+/);
    
  2. or download this
    $str = fraction($str);
    ...
    ...
       }
       return $str;
    }
    
  3. or download this
    if ($str =~ /\d+_\d+/) {
       $str = fraction($str)
    ...
    } else {
       default
    }
    
  4. or download this
    $str = fraction($str)       if ($str =~ /\d+_\d+/)
    
  5. or download this
    convert_ratio_to_decimal( \$str );
    
  6. or download this
    sub convert_ratio_to_decimal (\$) { ..... };
    
    convert_ratio_to_decimal( $str );
    
  7. or download this
    $obj->convert_ration_to_decimal();
    
  8. or download this
    $error->logBadDateError( $str ) if (ErrorTracking::invalidDate( $str )
    +)
    
  9. or download this
    $varName = qr(regex goes here);
    if ( $str =~ /$UnderscoredNumber/ ) ...       # poor
    if ( $str =~ /$SimpleRatio/ ) ...             # good
    if ( $str =~ /$Ratio::simpleFraction/ ) ...   # better