01-30-2013
Well that's one way of doing it!!!! Job done then. [solved]
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Could somone please tell me what happened when I reboot my computer, it take too long to pass the part it said "starting sendmail"
I only changed the server name and when I reboot the server, all of the services are running except when it got to :
starting sendmail
it take toooo long to... (1 Reply)
Discussion started by: lapnguyen
1 Replies
2. UNIX for Advanced & Expert Users
Hi All,
1st HDD is loaded with Windows 2000 Professional and I have installed Red Hat ES 3.0 on second HDD(80GB). After linux installation failed to load windows and boot stucks with displaying only L How to fix this issue
Thanks in advance for your valuable answer.
Regards,
Bachegowda (1 Reply)
Discussion started by: bache_gowda
1 Replies
3. Solaris
i have a sunfire v100 machine with 256mb memory. Can i install a PC memory on sunfire v100? someone on irc told me that this is possible, by toggling jp7 which enables/disables pc133u/pc133. can someone please explain if this is true?
thanks (3 Replies)
Discussion started by: marcpascual
3 Replies
4. HP-UX
Hello, have HP Visualize C3600 workstation. Issue is as follows:
When I attempt to boot, unit will not boot successfully and will halt at a menu, the same menu as when during a boot one hits any key within 10 seconds to discontinue. When I attempt to boot with Boot primary, both with IPL... (17 Replies)
Discussion started by: davel1000
17 Replies
5. Solaris
I had logged into Server via ALOM and was placed into runlevel 5 other than 3 which is default.
I did a svcadm delete boot-archive, and was promptly placed in runlevel 3.
Now, I am unable to do a telnet or login into the server through any other service.
bash-3.00# svcs -a
svcs -a
STATE ... (3 Replies)
Discussion started by: praveenr
3 Replies
6. Red Hat
Hi,
I have a laptop with two os running in it, Windows XP & RHEL5. Accidentally, we have deleted the windows entry in grub.conf file. Later we connected the hard disk of laptop to another system & deleted the linux partitions from the disk management tool of windows.
Now the issue is, the... (7 Replies)
Discussion started by: Amol21
7 Replies
7. Solaris
My coworkers and I are trying to pull DNS settings off of an old Sunfire V100 server, We have the username and password but are unable to figure out the commands to access any of the needed information. Is there somewhere I could look in order to get the commands? Or does anyone know the series of... (1 Reply)
Discussion started by: Fhistleb
1 Replies
8. Solaris
does anyone have solaris pkg 137481-02, could you email to me, it wont let me download it anymore.
No (0 Replies)
Discussion started by: dan7225
0 Replies
9. Solaris
Hi all
i have an issue
when i change auto-boot?=false and reboot it
again it is going to auto-boot?=true
can any one tell that
what should i do for auto-boot?=false for permanently
thank you in advance (11 Replies)
Discussion started by: wkbn86
11 Replies
10. SCO
Hi,
I am using SCO OpenServer 5
During boot I get this message:
PANIC: HTFS: Bad directory ino 2 (offset 0) on HTFS dev hd (1/42)
Cannot dump 8095 pages to dumpdev hd (1/41): Space for only 0 pages
Dump not completed
How can I fix this? I have no boot/root floppy.
If it is a "disk... (8 Replies)
Discussion started by: nubian_sundance
8 Replies
LEARN ABOUT OSX
moose::cookbook::roles::recipe3
Moose::Cookbook::Roles::Recipe3(3) User Contributed Perl Documentation Moose::Cookbook::Roles::Recipe3(3)
NAME
Moose::Cookbook::Roles::Recipe3 - Applying a role to an object instance
VERSION
version 2.0205
SYNOPSIS
package MyApp::Role::Job::Manager;
use List::Util qw( first );
use Moose::Role;
has 'employees' => (
is => 'rw',
isa => 'ArrayRef[Employee]',
);
sub assign_work {
my $self = shift;
my $work = shift;
my $employee = first { !$_->has_work } @{ $self->employees };
die 'All my employees have work to do!' unless $employee;
$employee->work($work);
}
package main;
my $lisa = Employee->new( name => 'Lisa' );
MyApp::Role::Job::Manager->meta->apply($lisa);
my $homer = Employee->new( name => 'Homer' );
my $bart = Employee->new( name => 'Bart' );
my $marge = Employee->new( name => 'Marge' );
$lisa->employees( [ $homer, $bart, $marge ] );
$lisa->assign_work('mow the lawn');
DESCRIPTION
In this recipe, we show how a role can be applied to an object. In this specific case, we are giving an employee managerial
responsibilities.
Applying a role to an object is simple. The Moose::Meta::Role object provides an "apply" method. This method will do the right thing when
given an object instance.
MyApp::Role::Job::Manager->meta->apply($lisa);
We could also use the "apply_all_roles" function from Moose::Util.
apply_all_roles( $person, MyApp::Role::Job::Manager->meta );
The main advantage of using "apply_all_roles" is that it can be used to apply more than one role at a time.
We could also pass parameters to the role we're applying:
MyApp::Role::Job::Manager->meta->apply(
$lisa,
-alias => { assign_work => 'get_off_your_lazy_behind' },
);
We saw examples of how method exclusion and alias working in roles recipe 2.
CONCLUSION
Applying a role to an object instance is a useful tool for adding behavior to existing objects. In our example, it is effective used to
model a promotion.
It can also be useful as a sort of controlled monkey-patching for existing code, particularly non-Moose code. For example, you could create
a debugging role and apply it to an object at runtime.
AUTHOR
Stevan Little <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Infinity Interactive, Inc..
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.12.5 2011-09-06 Moose::Cookbook::Roles::Recipe3(3)