Venus::Role::Printable

Printable Role

Printable Role for Perl 5

method: print method: print_pretty method: print_string method: say method: say_pretty method: say_string

package Example;

use Venus::Class;

with 'Venus::Role::Dumpable';
with 'Venus::Role::Printable';

attr 'test';

sub execute {
  return [@_];
}

sub printer {
  return [@_];
}

package main;

my $example = Example->new(test => 123);

# $example->say;

This package provides a mechanism for outputting (printing) objects or the return value of a dispatched method call to STDOUT.

The print method prints a stringified representation of the underlying data.

print(Any @data) (Any)

{ since => '0.01', }

=example-1 print

package main;

my $example = Example->new(test => 123);

my $print = $example->print;

# bless({test => 123}, 'Example')

# 1

The print_pretty method prints a stringified human-readable representation of the underlying data.

print_pretty(Any @data) (Any)

{ since => '0.01', }

=example-1 print_pretty

package main;

my $example = Example->new(test => 123);

my $print_pretty = $example->print_pretty;

# bless({ test => 123 }, 'Example')

# 1

The print_string method prints a string representation of the underlying data without using a dump. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

print_string(Str | CodeRef $method, Any @args) (Any)

{ since => '0.09', }

=example-1 print_string

package main;

my $example = Example->new(test => 123);

my $print_string = $example->print_string;

# 'Example'

# 1

The say method prints a stringified representation of the underlying data, with a trailing newline.

say(Any @data) (Any)

{ since => '0.01', }

=example-1 say

package main;

my $example = Example->new(test => 123);

my $say = $example->say;

# bless({test => 123}, 'Example')\n

# 1

The say_pretty method prints a stringified human-readable representation of the underlying data, with a trailing newline.

say_pretty(Any @data) (Any)

{ since => '0.01', }

=example-1 say_pretty

package main;

my $example = Example->new(test => 123);

my $say_pretty = $example->say_pretty;

# bless({ test => 123 }, 'Example')\n

# 1

The say_string method prints a string representation of the underlying data without using a dump, with a trailing newline. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

say_string(Str | CodeRef $method, Any @args) (Any)

{ since => '0.09', }

=example-1 say_string

package main;

my $example = Example->new(test => 123);

my $say_string = $example->say_string;

# "Example\n"

# 1

t/Venus.t: pdml: authors t/Venus.t: pdml: license

29 POD Errors

The following errors were encountered while parsing the POD:

Around line 13:

Unknown directive: =name

Around line 21:

Unknown directive: =tagline

Around line 29:

Unknown directive: =abstract

Around line 37:

Unknown directive: =includes

Around line 50:

Unknown directive: =synopsis

Around line 86:

Unknown directive: =description

Around line 95:

Unknown directive: =method

Around line 99:

Unknown directive: =signature

Around line 103:

Unknown directive: =metadata

Around line 143:

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

Around line 153:

Unknown directive: =method

Around line 158:

Unknown directive: =signature

Around line 162:

Unknown directive: =metadata

Around line 207:

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

Around line 217:

Unknown directive: =method

Around line 223:

Unknown directive: =signature

Around line 227:

Unknown directive: =metadata

Around line 255:

Unknown directive: =method

Around line 260:

Unknown directive: =signature

Around line 264:

Unknown directive: =metadata

Around line 304:

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

Around line 314:

Unknown directive: =method

Around line 319:

Unknown directive: =signature

Around line 323:

Unknown directive: =metadata

Around line 368:

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

Around line 378:

Unknown directive: =method

Around line 385:

Unknown directive: =signature

Around line 389:

Unknown directive: =metadata

Around line 417:

Unknown directive: =partials