Generally, it's a mistake to map a C interface directly to a Perl one. With some careful thought, you can usually do much better by moulding the interface to Perl's strengths. An example that springs to mind is the Win32 Registry API: painful and tedious to use from C, with all those API calls, and all that mucking about checking return codes. By contrast, Win32::TieRegistry is a joy to use: to read from the Registry, you just read from a (tied) hash; to write to the Registry, you simply write to the hash.
As described in On Interfaces and APIs, the way to go about designing a new API is to "play test" it. Write some tests for it. Start by imagining the perfect interface without worrying about implementation constraints. Then refine it.
In reply to Re: Question about module interface style
by eyepopslikeamosquito
in thread Question about module interface style
by Leviathan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |