By carefully abusing list vs. scalar context, the same method can be made to return a single roll or a list of several rolls
Why would this be abusing context? That is exactly what wantarray is for ...
Also, as an amusing trick, I'd like to see an OppositeFace () method.
sub opposite_face { my $self = shift; return $self->{size} - $self->{face} + 1; }
Tony
Update: DOH!
In reply to Re: (ichimunki) Re (tilly) 1: Dice::Dice
by salvadors
in thread Dice::Dice
by coreolyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |