Try %{ 'A::B' . $type . '::' }
Remember to include the extra '::' on the end.
In reply to Re^3: multiple package in one file by friedo in thread multiple packages in one file by jeanluca