added basic perl solution