develooper Front page | perl.moose | Postings from February 2012

Removing a role

Thread Next
From:
ynon perek
Date:
February 10, 2012 08:08
Subject:
Removing a role
Message ID:
CAJ9Vtg8B_6_2dEGQPN4PY6FLUapo3U2Co70Txi8yr-P_pSZHEw@mail.gmail.com
Hello All,
I know that we can add a role to an instance by using apply_all_roles (or
the meta).

Is it also possible to remove a role from an instance ?

What I want to do is something in the line of:

my $badguy = Zombie->new;

$badguy->eat_brain();

apply_all_roles($badguy, 'Strong');

# some time pass

remove_role($badguy, 'Strong');

Thanks In Advance,
  Ynon


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About