# This code was recently posted to the PHL.pm mailing list # How many errors can you find? ---------------------------------------------------------------- I'm passing a zip through this rule: if(country eq 'CA' and in_range(zip, 'A1A1A1', 'S9Z9Z9') or in_range(zip, 'X1A1A1', 'Y9Z9Z9'))", ######################################## # in_range(value, low, high) # # Returns true if $value is gt $low and lt $high using lexographic # comparison. Returns false otherwise # ######################################## sub in_range { my($value, $low, $high) = @_; return(($low lt $value) && ($value lt $high) || $value == $low || $value == $high ); }