GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Venus::Name(3) User Contributed Perl Documentation Venus::Name(3)

Venus::Name - Name Class

Name Class for Perl 5

  package main;
  use Venus::Name;
  my $name = Venus::Name->new('Foo/Bar');
  # $name->package;

This package provides methods for parsing and formatting package namespace strings.

This package inherits behaviors from:

Venus::Kind::Utility

This package integrates behaviors from:

Venus::Role::Accessible

Venus::Role::Buildable

Venus::Role::Explainable

Venus::Role::Valuable

This package provides the following methods:

  default() (string)

The default method returns the default value, i.e. 'Venus'.

Since 0.01

default example 1
  # given: synopsis;
  my $default = $name->default;
  # "Venus"
    

  dist() (string)

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

Since 0.01

dist example 1
  # given: synopsis;
  my $dist = $name->dist;
  # "Foo-Bar"
    

  explain() (string)

The explain method returns the package name and is used in stringification operations.

Since 0.01

explain example 1
  # given: synopsis;
  my $explain = $name->explain;
  # "Foo/Bar"
    

  file() (string)

The file method returns a file representation of the name.

Since 0.01

file example 1
  # given: synopsis;
  my $file = $name->file;
  # "foo__bar"
    

  format(string $method, string $format) (string)

The format method calls the specified method passing the result to the core "sprintf" function with itself as an argument. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

Since 0.01

format example 1
  # given: synopsis;
  my $format = $name->format('file', '%s.t');
  # "foo__bar.t"
    

  label() (string)

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

Since 0.01

label example 1
  # given: synopsis;
  my $label = $name->label;
  # "Foo_Bar"
    

  lookslike_a_file() (string)

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

Since 0.01

lookslike_a_file example 1
  # given: synopsis;
  my $lookslike_a_file = $name->lookslike_a_file;
  # ""
    

  lookslike_a_label() (string)

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

Since 0.01

lookslike_a_label example 1
  # given: synopsis;
  my $lookslike_a_label = $name->lookslike_a_label;
  # ""
    

  lookslike_a_package() (string)

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

Since 0.01

lookslike_a_package example 1
  # given: synopsis;
  my $lookslike_a_package = $name->lookslike_a_package;
  # ""
    

  lookslike_a_path() (string)

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

Since 0.01

lookslike_a_path example 1
  # given: synopsis;
  my $lookslike_a_path = $name->lookslike_a_path;
  # 1
    

  lookslike_a_pragma() (string)

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

Since 0.01

lookslike_a_pragma example 1
  # given: synopsis;
  my $lookslike_a_pragma = $name->lookslike_a_pragma;
  # ""
    

  package() (string)

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

Since 0.01

package example 1
  # given: synopsis;
  my $package = $name->package;
  # "Foo::Bar"
    

  path() (string)

The path method returns a path representation of the name.

Since 0.01

path example 1
  # given: synopsis;
  my $path = $name->path;
  # "Foo/Bar"
    

This package overloads the following operators:

This package overloads the "" operator.

example 1

  # given: synopsis;
  my $result = "$name";
  # "Foo/Bar"
    

example 2

  # given: synopsis;
  my $result = "$name, $name";
  # "Foo/Bar, Foo/Bar"
    
This package overloads the "." operator.

example 1

  # given: synopsis;
  my $package = $name . 'Baz';
  # "Foo::BarBaz"
    
This package overloads the "eq" operator.

example 1

  # given: synopsis;
  $name eq 'Foo/Bar';
  # 1
    

example 2

  package main;
  use Venus::Name;
  my $name1 = Venus::Name->new('Foo\Bar');
  my $name2 = Venus::Name->new('Foo\Bar');
  $name1 eq $name2;
  # 1
    
This package overloads the "ne" operator.

example 1

  # given: synopsis;
  $name ne 'Foo\Bar';
  # 1
    

example 2

  package main;
  use Venus::Name;
  my $name1 = Venus::Name->new('FooBar');
  my $name2 = Venus::Name->new('Foo_Bar');
  $name1 ne $name2;
  # 1
    
This package overloads the "qr" operator.

example 1

  # given: synopsis;
  "Foo/Bar" =~ qr/$name/;
  # 1
    
This package overloads the "~~" operator.

example 1

  # given: synopsis;
  my $result = $name ~~ 'Foo/Bar';
  # 1
    

Awncorp, "awncorp@cpan.org"

Copyright (C) 2022, Awncorp, "awncorp@cpan.org".

This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.

2023-11-27 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.