capitalization(3)

πŸ“¦
version 0.03 Β· 2 versions
, in fedora 43

πŸ’… capitalization β€” no capitalization on method names πŸ’…

okay bestie, so this is capitalization(3) from the User Contributed Perl Documentation section, and it's literally about letting you write method names however your little heart desires. no cap.


✨ SYNOPSIS ✨

use XML::DOM;
no capitalization 'XML::DOM';

my $parser = XML::DOM::Parser->new;

# no capitalization ..
my $nodes = $parser->get_elements_by_tag_name("Foo");

# this can be OK
my $nodes = $parser->getElementsByTagName("Foo");

so you use the module, you hit it with a no capitalization 'XML::DOM', and boom β€” both of those method calls just work. the way that's so convenient, honestly. 🫢


🌸 DESCRIPTION 🌸

capitalization.pm is here to let you use familiar style on method naming. that's it. that's the whole vibe. it's giving "i refuse to camelCase and you can't stop me." periodt. πŸ’–


πŸŽ€ RULES πŸŽ€

okay so the rules are actually super simple, listen:

  • A lower case character followed by upper case sequence gets split with "_", and that upper case sequence gets lower cased. Example: "fooBar" becomes "foo_bar". slay.
  • All other upper case characters get lower cased. Examples: "FOOs" becomes "foos", and "_Foo" becomes "_foo". iconic behavior fr fr.

😭 CAVEATS 😭

🚨 "no capitalization __PACKAGE__;"

okay this one matters, don't skip it bestie:

If you want to use the capitalization pragma in a module and add lower case API in the module itself, then you should use the pragma after all subs are defined.

like, after. all of them. define your subs first, then the pragma. otherwise it's not gonna do what you want and you'll be sitting there like πŸ’€. iykyk.


πŸ‘‘ AUTHOR πŸ‘‘

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

and the legal tea, verbatim vibe-wise:

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

so yeah, free software, same terms as Perl itself. πŸ’œ


🌈 SEE ALSO 🌈

  • Symbol::Approx::Sub

go look at it, it's cute, it's related. πŸ¦‹


and that's the whole page, bestie!! 🌸 this was rendered from perl v5.42.0, dated 2025-07-25, page capitalization(3). mwah, go lowercase some method names, you absolute main character. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from