moosex::attribute::chainedclone(3pm) [debian man page]
MooseX::Attribute::ChainedClone(3pm) User Contributed Perl Documentation MooseX::Attribute::ChainedClone(3pm)NAME
MooseX::Attribute::ChainedClone - Attribute that returns a cloned instance
VERSION
version 1.0.1
SYNOPSIS
package Test;
use Moose;
has debug => (
traits => [ 'ChainedClone' ],
is => 'rw',
isa => 'Bool',
default => 0,
);
sub complex_method
{
my $self = shift;
#...
print "helper message" if $self->debug;
#...
}
sub clone {
my $self = shift;
# custom clone code here
# defaults to:
return bless { %$self }, ref $self;
}
1;
Which allows for:
my $test = Test->new;
$test->debug(1)->complex_method; # debug enabled
# complex_method is called on a cloned instance
# with debug set to 1
$test->complex_method; # debug is still disabled on $test
$test->debug(1); # returns a cloned $test instance with debug set to 1
$test->debug; # returns 0
DESCRIPTION
MooseX::Attribute::ChainedClone is a Moose Trait which allows for method chaining on accessors by returning a cloned instance of $self on
write/set operations.
If $self has a "clone" method, this method is invoked to clone the instance. This allows for easy integration with MooseX::Clone or any
custom made clone method. If no "clone" method is available, the new instance is build using "bless { %$self }, ref $self".
AUTHORS
o Moritz Onken <onken@netcubed.de>
o David McLaughlin <david@dmclaughlin.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Moritz Onken.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-01-28 MooseX::Attribute::ChainedClone(3pm)
Check Out this Related Man Page
MooseX::Attribute::Chained(3pm) User Contributed Perl Documentation MooseX::Attribute::Chained(3pm)NAME
MooseX::Attribute::Chained - Attribute that returns the instance to allow for chaining
VERSION
version 1.0.1
SYNOPSIS
package Test;
use Moose;
has debug => (
traits => [ 'Chained' ],
is => 'rw',
isa => 'Bool',
);
sub complex_method
{
my $self = shift;
#...
print "helper message" if $self->debug;
#...
}
1;
Which allows for:
my $test = Test->new;
$test->debug(1)->complex_method;
$test->debug(1); # returns $test
$test->debug; # returns 1
DESCRIPTION
MooseX::Attribute::Chained is a Moose Trait which allows for method chaining on accessors by returning $self on write/set operations.
AUTHORS
o Moritz Onken <onken@netcubed.de>
o David McLaughlin <david@dmclaughlin.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Moritz Onken.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-01-28 MooseX::Attribute::Chained(3pm)
Hi,
I'm porting code from Windows to HP-UX 11, compiling with g++.
I'm getting a compilation error on the system's debug.h include file, which is included very indirectly through a series of other system include files. The one I am including is <map> .
The errors I am getting are:... (4 Replies)
Hi,
i' m using eclipse 3.2.2 on ubuntu. When i debug a program (C language) i cannot see any variable in the variables view. From the console (debug perspective) i can see the message: no source file named class.c. What is the problem???
thanks (1 Reply)
hi
i am not getting what exactly bless function do in perl explanation in perldoc is not very clear i tried to search on google but i am getting confused or rather not getting at all. can anybody explain in short what it does in following example as well as in general ?
sub new {
my... (1 Reply)
hello guys
i am trying to code a program that will read the last line from a file using c language. i got no experience with c, so my code is giving me plenty of errors. could you help me debug ??
code:
# include <stdio.h>
typedef int function;
void main(void){
int count =... (9 Replies)
Hi,
I am using perl with some EDA tool. There is an API function that can be iterate.
I try to check the ref and get that it is a string. I assume that it is a hash
sub aaa {
my $obj = shift;
$name = $obj->name;
print ref $obj,"\n";
foreach my $var(keys %{$obj}) {
my... (0 Replies)
What is the best method to use to clone a Redhat machine, to ensure all software and config can be easily installed on new hardware?
Thank you! (3 Replies)
Hi
I have the following difficulty:
the NetApp admin has clone one file system from one red hatserver and presented this cloned LUN into another redhat server.
I can see the LUN as:
fdisk -l
Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units =... (1 Reply)
I'm using Spacewalk 2.6 and successfully created base CentOS 6 and 7 channels and can kickstart off those. However, I recently created 6.8 and 7.2 cloned channels with the spacewalk-clone-by-date command, but cannot kickstart from those.
It seems that I may need to setup a kickstartable tree... (0 Replies)
Steps taken:-
1. Snapshot an existing ZFS filesystem.
2. Created clone from snapshot.
3. Updated files on cloned ZFS filesystem.
4. Snapshot of cloned ZFS filesystem.
5. Attempted to promote clone ZFS and get error message. See below.
#zfs list -rt all /rpool/ai
NAME ... (2 Replies)