package capitalization; use strict; use vars qw($VERSION); $VERSION = 0.01; use Devel::Symdump; my %done; sub unimport { my($class, @mods) = @_; for my $mod (@mods) { next if $done{$mod}; my $file = mod2file($mod); require $file unless $INC{$file}; my $dump = Devel::Symdump->new($mod); for my $meth (map { s/^\Q$mod\E:://; $_ } $dump->functions) { my $new = nocap($meth); if ($new ne $meth) { no strict 'refs'; *{"$mod\::$new"} = \&{"$mod\::$meth"}; } } $done{$mod} = 1; } } sub nocap { my $method = shift; $method =~ s/(?<=[a-z])([A-Z]+)/"_" . lc($1)/eg; lcfirst $method; } sub mod2file { my $mod = shift; $mod =~ s!::!/!g; return "$mod.pm"; } 1; __END__ =head1 NAME capitalization - no capitalization on method names =head1 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"); =head1 DESCRIPTION capitalization.pm allows you to use familiar style on method naming. =head1 AUTHOR Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L<Symbol::Approx::Sub> =cut

In reply to capitalization.pm by miyagawa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.