Venus::Role::Stashable - Stashable Role
Stashable Role for Perl 5
package Example; use Venus::Class; with 'Venus::Role::Stashable'; attr 'test'; package main; my $example = Example->new(test => time); # $example->stash;
This package modifies the consuming package and provides methods for stashing data within the object.
This package provides the following methods:
stash(Any $key, Any $value) (Any)
The stash method is used to fetch and stash named values associated with the object. Calling this method without arguments returns all values.
Since 0.01
0.01
package main; my $example = Example->new(test => time); my $stash = $example->stash; # {}
package main; my $example = Example->new(test => time); my $stash = $example->stash('test', {1..4}); # { 1 => 2, 3 => 4 }
package main; my $example = Example->new(test => time); my $stash = $example->stash('test'); # undef
To install Venus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Venus
CPAN shell
perl -MCPAN -e shell install Venus
For more information on module installation, please visit the detailed CPAN module installation guide.