sub new { my $Di = { Sides => 6, Face => 1 }; #default six sider, sitting with 1 up bless $Di, "Dice::Di"; } sub Roll { my $self = shift; my $newface = int( rand( $self->{'Sides'} ) + 1); $self->{'Face'} = $newface; return $newface; } sub Rolls { #call with @results = $Di->Rolls( integer ); my $self = shift; my $times = shift; my @faces; for (1..$times) { my $rolled = $self->Roll(); push( @faces, $rolled ); } return @faces; } sub CurrentFace { my $self = shift; return $self->{'Face'}; }