Only check perl dependency when it's requirement. Fix #238