Hello, Thanks for your response!
On Tue, Jun 11, 2024 at 03:28:58PM +0100, Neil Bowers wrote: > I think the namespace XML::Invoice is fine. Ok, that's a start. > I thought it would be helpful to mention a namespace / permissions > constraint you should be aware of, for CPAN. I'm guessing that your > parser produces objects that are instances of XML::Invoice? Not quite. It produces instances of XML::Invoice::Parser because I may add another package XML::Invoice::Generator in the future. > I would call the CPAN distribution XML-Invoice, and assume it would > contain at least two classes: XML::Invoice and XML::Invoice::Parser? The top level class is XML::Invoice::Parser with various subclasses such as XML::Invoice::Parser::CrossIndustryInvoice or XML::Invoice::Parser::UBL. There is no XML::Invoice class right now. > And a later release might also include XML::Invoice::Generator. Yes. > When you release something to CPAN (by uploading it to PAUSE), you > must have a module with a name that corresponds to the distribution > name. Yes...right now I have a module XML::Invoice::Parser (residing in lib/XML/Invoice/Parser.pm) in there. The distribution is called XML-Invoice-Parser. > So if you release a distribution XML-Invoice, it has to contain a > module XML::Invoice, and either (a) there are currently no indexing > permissions on XML:::Invoice (in which case you'll be granted the > first-come indexing permission), or (b) you already have an indexing > permission (either first-come or co-maint) on XML::Invoice. So this is where I am probably running into the constraint you mention: > We occasionally see problems where someone releases a distribution > with a name like Image-Formats which contains Image::Formats::PNG, > Image::Formats::JPEG, etc, but no Image::Formats module. I do indeed not have a lib/XML/Invoice.pm right now: https://github.com/jgrassler/XML-Invoice-Parser/tree/master/lib/XML/Invoice > This constraint was added to PAUSE so that people couldn't jump in and > snatch the first-come indexing permission on a module name that > clearly should be associated with some existing module names. ...and this is kind of what I am planning on doing right now. So do you think it would be ok to snatch the XML::Invoice name space with bare lib/XML/Invoice.pm that merely declares the package XML::Invoice? > The other option is that you could call your parser > XML::InvoiceParser, and have XML::InvoiceParser::Invoice for the > invoice objects. But I think that's clunky, and leaves XML::Invoice > unclaimed, for someone else to bag. Yeah, that's clunky indeed. I'd rather avoid that. So just to make sure I understand: if I released the module as-is with XML::Invoice::Parser being the top level module, I'd leave XML::Invoice for someone else to bag, right? Cheers, Johannes -- Phone: +49 176 24 24 20 83 WWW: http://btw23.de/johannes/ GPG Key fingerprint: 2A3F 5FEC D752 944C BD9C B25A 651A B200 1434 C358