Text::Naming::Convention - Naming or Renaming( for identifiers, mostly )


Text-Naming-Convention documentation  | view source Contained in the Text-Naming-Convention distribution.

Index


default_convention

get or set default convention, default is '_'. valid values are ( '_', '-', 'UpperCamelCase', 'lowerCamelCase' ). return the default convention.

default_keep_uppers

keep words of uppers or not, here uppers means all uppers like 'BAR', not 'bAr'. default value is true

naming

given a list of words, return the named string the last arg can be hashref that supplies option like: { convention => 'UpperCamelCase' }

renaming

given a name, renaming it with another convention. the last arg can be hashref that supplies option like: { convention => 'UpperCamelCase' }

return the renamed one.

if the convention is the same as the name, just return the name.

if without arguments and $_ is defined and it's not a reference, renaming $_

NAME

Top

Text::Naming::Convention - Naming or Renaming( for identifiers, mostly )

VERSION

Top

This document describes Text::Naming::Convention version 0.06

SYNOPSIS

Top

    use Text::Naming::Convention qw/naming renaming/;
    my $name = naming( 'foo', 'bar', 'baz' ) # got foo_bar_baz
    $name = naming( 'foo', 'bar', 'baz',
            { convention => 'UpperCamelCase'} ); # got FooBarBaz
    my $new_name = renaming( 'FooBarBaz' ); # got foo_bar_baz
    $new_name = renaming( 'FooBarBaz',
            { convention => 'lowerCamelCase' } ); # got fooBarBaz




DESCRIPTION

Top

This's a simple module for naming and renaming, mostly for identifiers or something like that.

I'm tired of writing renaming sub, so I chose to create this module, wish it can help you too :)

DEPENDENCIES

Top

None.

INCOMPATIBILITIES

Top

None reported.

BUGS AND LIMITATIONS

Top

No bugs have been reported.

AUTHOR

Top

sunnavy <sunnavy@bestpractical.com>

LICENCE AND COPYRIGHT

Top


Text-Naming-Convention documentation  | view source Contained in the Text-Naming-Convention distribution.