passing potentially undefined values around because perl