MooseX::MultiMethods(3pm) User Contributed Perl Documentation MooseX::MultiMethods(3pm)NAME
MooseX::MultiMethods - Multi Method Dispatch based on Moose type constraints
VERSION
version 0.10
SYNOPSIS
package Paper; use Moose;
package Scissors; use Moose;
package Rock; use Moose;
package Lizard; use Moose;
package Spock; use Moose;
package Game;
use Moose;
use MooseX::MultiMethods;
multi method play (Paper $x, Rock $y) { 1 }
multi method play (Paper $x, Spock $y) { 1 }
multi method play (Scissors $x, Paper $y) { 1 }
multi method play (Scissors $x, Lizard $y) { 1 }
multi method play (Rock $x, Scissors $y) { 1 }
multi method play (Rock $x, Lizard $y) { 1 }
multi method play (Lizard $x, Paper $y) { 1 }
multi method play (Lizard $x, Spock $y) { 1 }
multi method play (Spock $x, Rock $y) { 1 }
multi method play (Spock $x, Scissors $y) { 1 }
multi method play (Any $x, Any $y) { 0 }
my $game = Game->new;
$game->play(Paper->new, Rock->new); # 1, Paper covers Rock
$game->play(Spock->new, Paper->new); # 0, Paper disproves Spock
$game->play(Spock->new, Scissors->new); # 1, Spock smashes Scissors
DESCRIPTION
This module provides multi method dispatch based on Moose type constraints. It does so by providing a "multi" keyword that extends the
"method" keyword provided by MooseX::Method::Signatures.
When invoking a method declared as "multi" a matching variant is being searched in all the declared multi variants based on the passed
parameters and the declared type constraints. If a variant has been found, it will be invoked. If no variant could be found, an exception
will be thrown.
AUTHOR
Florian Ragwitz <rafl@debian.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Florian Ragwitz.
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.10.1 2010-01-03 MooseX::MultiMethods(3pm)
Check Out this Related Man Page
MooseX::Types::Moose(3pm) User Contributed Perl Documentation MooseX::Types::Moose(3pm)NAME
MooseX::Types::Moose - Type exports that match the types shipped with Moose
VERSION
version 0.41
SYNOPSIS
package Foo;
use Moose;
use MooseX::Types::Moose qw( ArrayRef Int Str );
use Carp qw( croak );
has 'name',
is => 'rw',
isa => Str;
has 'ids',
is => 'rw',
isa => ArrayRef[Int];
sub add {
my ($self, $x, $y) = @_;
croak 'First arg not an Int' unless is_Int($x);
croak 'Second arg not an Int' unless is_Int($y);
return $x + $y;
}
1;
DESCRIPTION
This package contains a virtual library for MooseX::Types that is able to export all types known to Moose. See MooseX::Types for general
usage information.
METHODS
type_storage
Overrides MooseX::Types::Base' "type_storage" to provide a hash reference containing all built-in Moose types.
SEE ALSO
MooseX::Types::Moose, Moose, Moose::Util::TypeConstraints
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.
AUTHOR
Robert "phaylon" Sedlacek <rs@474.at>
COPYRIGHT AND LICENSE
This software is copyright (c) 2007 by Robert "phaylon" Sedlacek.
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.18.2 2013-12-21 MooseX::Types::Moose(3pm)
I posted this question in the dummies forums, but I would like to get a more expert opinion... I am looking for a new OS to play with. I have a celron 450 running slackware linux, a powermac G4 450 running Mac OS X (Which by the way has 81 days of uptime as of this moment), a PowerBook G3 running... (5 Replies)
Whats is the best linux system in your suggestion for running a game server for free or decent price? I play counter-strike, and have my own sevrer, but windows is terrible for a server machine. It also needs to be able to be networked with a windows system, and support my video card (geforce2) Any... (1 Reply)
I'm thinking of buying that new $199 dollar pc from Wal-Mart. I already have a high performance system but I want another system just to play around with and get started using Linux and Unix. How much disk space is needed to run Linux and Unix for developing software? Would this be a good buy?
... (2 Replies)
Dear all,
Please advise what approach can remove all line break from a text file?
e.g.
Source file:
A
B
C
Target file:
A, B, C
Thanks,
Rock (5 Replies)
I'm trying to create this game in Unix.
This is what I have so far:
echo "Player one: Choose (R)ock, (P)aper (S)cissors"
stty -echo
read Pone
case $Pone
in
R) echo "Good Choice! Let's see what Player two chooses.";;
P) echo "Good Choice! Let's see what Player two chooses.";;
S) echo... (5 Replies)
can anyone tell me why this code doesn't work how its supposed to, its the hangman game but it doesn't play how its supposed to
#!/bin/bash
NoAttempts="0"
livesgiven="5"
LivesRemain=$livesgiven
LettersAttempted=""
wordfile=words
numwords=0
function menu()
{
clear
cat << menu... (1 Reply)
Hi,
In my application,I want to find out the OS name and based on OS I want to do some specific operations.So I write some code based on it in JAVA but I am able to get the OS name but Not able to use the method specific to OS.I write a simple code to check it and found that it is not going to... (1 Reply)
Hi
Server configuration is
Processor : xeon 64 bit
Os: centos 5
We are in the process of setting up the Rock Cluster with 5 node.Currently the node are communication with each other
however the disk space is not being shared in the cluster
We would like to know how to used one disk space... (1 Reply)
Heya, everyone I'm trying to play a random file from my Videos file i have come up with this. But i need help to play the movie with vlc. I'm sorry if this is a silly question I'm just stuck.
#!/bin/bash
Movies='/home/josh/Videos'
cd $Movies
ls | sed -n "$((RANDOM%$(ls | wc... (2 Replies)
Hey all. I've been working on some fun with C and decided to write a Rock Paper Scissors game. The problem is, that when I try to compile the file, it gives "lvalue required as left operand of assignment" error. The error line is here:
for ((point1=0 && point2=0); ((point1=3) || (point2=3));... (4 Replies)
approximately the same question as the last time, but unfortunately I didn't get
a working answer.
I made a script with bash and gtkdialog that create a play-list. The output is for example :
gtk-media-pause | CB60471-05 - Gilbert, Brantley - Country Must Be Country Wide.zip | 28897 |... (3 Replies)
It seems that multi queue virtio functionality is enabled in the Redhat System being used, but I need to confirm if this functionality is working appropriately:
cat /usr/include/linux/virtio_net.hstruct virtio_net_config
{ /* The config defining mac address (if VIRTIO_NET_F_MAC) */ __u8 mac;... (2 Replies)
Hello Everyone,
i need to grep specific keyword in a file.
i want need solution to output.
example
file.txt
03-08-2019 21:02:20,938 ::: Recieve Data From Amazon :::
03-08-2019 21:02:20,938 IP : 192.168.1.1 | msg = Your confirmation code for 'Verify phone number' is xxxxx | sno =... (2 Replies)