pattern matching for values did not fit perl implementation