translate docs/v1.8 to perl sub