improve perl interface