I'd say XML::Writer got it wrong and should have used a hash reference rather than a flattened list. Note that Perl Best Practices, page 182, advises you to pass a hash ref, not a list of name/value pairs, and so allow you to catch some errors at compile time, rather than run time. This point, along with many others related to API design, is dicussed in detail in On Interfaces and APIs.
In reply to Re: API design - if you're expecting a scalar and an array ....
by eyepopslikeamosquito
in thread API design - if you're expecting a scalar and an array ....
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |