How do I choose a package name for a custom Perl module that does not collide with builtin or CPAN packages names?

前端 未结 6 549
南方客
南方客 2020-11-30 03:37

I have read the perldoc on modules, but I don\'t see a recommendation on naming a package so it won\'t collide with builtin or CPAN module/package names.

In the past

6条回答
  •  一向
    一向 (楼主)
    2020-11-30 03:56

    (I know this post is old, but as I've had to sort this out in the past few months, I thought I'd weigh in)

    At work we decided that 'Local::' felt too geographic. CompanyName:: had some problems for us too that aren't development related, I'll skip those, though I will say that CompanyName is long when you have to type it dozens of times.

    So we settled on 'Our::'. Sure, we're not 'CPAN Safe' as there could be the day when we want to use a CPAN module with the Our:: prefix. But it feels nice.

    Our::Data is our Class::DBI module Our::App is our generic app framework that does config handling and Getopt stuff

    Nice to read and nice to type.

提交回复
热议问题