in reply to flat earth distance

This line is wrong  ($lat1, $long1, $lat2, $long2) = @_; @_ outside a sub is empty. perlvar, perlsub