method name

Documentation for method name, assembled from the following types:

class Perl

From Perl

(Perl) method name

Instance method returning the name of the Perl object.

class Encoding

From Encoding

(Encoding) method name

method name(Encoding:D: --> Str)

Gets the primary name of the encoding.

class Attribute

From Attribute

(Attribute) method name

Defined as:

method name(Attribute:D: --> Str:D)

Returns the name of the attribute. Note that this is always the private name, so if an attribute is declared as has $.a, the name returned is $!a.

class Foo {
    has @!bar;
}
my $a = Foo.^attributes(:local)[0];
say $a.name;            # OUTPUT: «@!bar␤» 

class Distro

From Distro

(Distro) method name

Instance method returning the name of the Distro object. Returns "unknown" if the name could not be established.

class Kernel

From Kernel

(Kernel) method name

Instance method returning the name of the Kernel object. Returns "unknown" if the name could not be established.

class Routine

From Routine

(Routine) method name

method name(Routine:D: --> Str:D)

Returns the name of the sub or method.

role Metamodel::Naming

From Metamodel::Naming

(Metamodel::Naming) method name

method name($type)

Returns the name of the meta object, if any.

say 42.^name;       # OUTPUT: «Int␤» 

class Parameter

From Parameter

(Parameter) method name

Returns the variable name, which includes all sigils and twigils. This name is used internally when applied to code, or in a declaration determines the name declared. This name is not necessarily usable by a caller – if it is, it will also appear as an alias. Often, the name will chosen descriptively as a form of self-documentation.

If the parameter is anonymous, Nil will be returned.

class Pod::Block::Named

From Pod::Block::Named

(Pod::Block::Named) method name

method name(--> Str:D)

Returns the name of the block.

class Thread

From Thread

(Thread) method name

method name(Thread:D: --> Str:D)

Returns the user defined string, which can optionally be set during object creation in order to identify the Thread, or '<anon>' if no such string was specified.

my $t1 = Thread.new(code => { for 1..5 -> $v { say $v }});
my $t2 = Thread.new(code => { for 1..5 -> $v { say $v }}name => 'my thread');
 
say $t1.name;                 # OUTPUT: «<anon>␤» 
say $t2.name;                 # OUTPUT: «my thread␤» 

class VM

From VM

(VM) method name

Instance method returning the name of the VM object.

class Variable

From Variable

(Variable) method name

method name(Variable:D: str)

Returns the name of the variable, including the sigil.

class X::Attribute::NoPackage

From X::Attribute::NoPackage

(X::Attribute::NoPackage) method name

method name(--> Str:D)

Returns the name of the attribute

class X::Attribute::Package

From X::Attribute::Package

(X::Attribute::Package) method name

method name(--> Str:D)

Returns the name of the attribute that triggered this error.

class X::Bind::NativeType

From X::Bind::NativeType

(X::Bind::NativeType) method name

method name(--> Str:D)

Returns the name of the variable.

class X::IO::Link

From X::IO::Link

(X::IO::Link) method name

Returns the name of the link that could not be created.

class X::IO::Symlink

From X::IO::Symlink

(X::IO::Symlink) method name

Returns the path that symlink failed to create.

class X::Signature::NameClash

From X::Signature::NameClash

(X::Signature::NameClash) method name

method name(--> Str:D)

Returns the name that was used for more than one parameter.