Data::Object::Name

Name Class for Perl 5

method: dist method: file method: format method: label method: lookslike_a_file method: lookslike_a_label method: lookslike_a_package method: lookslike_a_path method: lookslike_a_pragma method: new method: package method: path

use Data::Object::Name;

my $name = Data::Object::Name->new('FooBar/Baz');

This package provides methods for converting "name" strings.

The dist method returns a package distribution representation of the name.

dist() : Str

=example-1 dist

# given: synopsis

my $dist = $name->dist; # FooBar-Baz

The file method returns a file representation of the name.

file() : Str

=example-1 file

# given: synopsis

my $file = $name->file; # foo_bar__baz

The format method calls the specified method passing the result to the core "sprintf" function with itself as an argument.

format(Str $method, Str $format) : Str

=example-1 format

# given: synopsis

my $file = $name->format('file', '%s.t'); # foo_bar__baz.t

The label method returns a label (or constant) representation of the name.

label() : Str

=example-1 label

# given: synopsis

my $label = $name->label; # FooBar_Baz

The lookslike_a_file method returns truthy if its state resembles a filename.

lookslike_a_file() : Bool

=example-1 lookslike_a_file

# given: synopsis

my $is_file = $name->lookslike_a_file; # falsy

The lookslike_a_label method returns truthy if its state resembles a label (or constant).

lookslike_a_label() : Bool

=example-1 lookslike_a_label

# given: synopsis

my $is_label = $name->lookslike_a_label; # falsy

The lookslike_a_package method returns truthy if its state resembles a package name.

lookslike_a_package() : Bool

=example-1 lookslike_a_package

# given: synopsis

my $is_package = $name->lookslike_a_package; # falsy

The lookslike_a_path method returns truthy if its state resembles a file path.

lookslike_a_path() : Bool

=example-1 lookslike_a_path

# given: synopsis

my $is_path = $name->lookslike_a_path; # truthy

The lookslike_a_pragma method returns truthy if its state resembles a pragma.

lookslike_a_pragma() : Bool

=example-1 lookslike_a_pragma

# given: synopsis

my $is_pragma = $name->lookslike_a_pragma; # falsy

=example-2 lookslike_a_pragma

use Data::Object::Name;

my $name = Data::Object::Name->new('[strict]');

my $is_pragma = $name->lookslike_a_pragma; # truthy

The new method instantiates the class and returns an object.

new(Str $arg) : Object

=example-1 new

use Data::Object::Name;

my $name = Data::Object::Name->new;

The package method returns a package name representation of the name given.

package() : Str

=example-1 package

# given: synopsis

my $package = $name->package; # FooBar::Baz

The path method returns a path representation of the name.

path() : Str

=example-1 path

# given: synopsis

my $path = $name->path; # FooBar/Baz

30 POD Errors

The following errors were encountered while parsing the POD:

Around line 10:

Unknown directive: =name

Around line 16:

Unknown directive: =abstract

Around line 22:

Unknown directive: =includes

Around line 39:

Unknown directive: =synopsis

Around line 47:

Unknown directive: =description

Around line 53:

Unknown directive: =method

Around line 57:

Unknown directive: =signature

Around line 69:

Unknown directive: =method

Around line 73:

Unknown directive: =signature

Around line 85:

Unknown directive: =method

Around line 90:

Unknown directive: =signature

Around line 102:

Unknown directive: =method

Around line 106:

Unknown directive: =signature

Around line 118:

Unknown directive: =method

Around line 122:

Unknown directive: =signature

Around line 134:

Unknown directive: =method

Around line 139:

Unknown directive: =signature

Around line 151:

Unknown directive: =method

Around line 156:

Unknown directive: =signature

Around line 168:

Unknown directive: =method

Around line 172:

Unknown directive: =signature

Around line 184:

Unknown directive: =method

Around line 188:

Unknown directive: =signature

Around line 208:

Unknown directive: =method

Around line 212:

Unknown directive: =signature

Around line 230:

=cut found outside a pod block. Skipping to next block.

Around line 232:

Unknown directive: =method

Around line 236:

Unknown directive: =signature

Around line 248:

Unknown directive: =method

Around line 252:

Unknown directive: =signature