sub grab { my $init = shift; my $class = ref($init) || $init; if ( shift =~ m/(^\d+)d(\d+)(.*)/i ) { my ( $type, $face, $qty, @dice ); $qty = $1; $type = $2; $face = $3; for ( my $i=1; $i <= $qty; $i++ ) { if ( $face =~ m/s$/i ) { push( @dice, Die->get($type,1) ); } else { push( @dice, Die->get($type) ); } } return bless { dice => \@dice }, $class; } else { croak "Invalid parameters to Dice::Dice->grab: $!"; } }