I'm working through some sample code, and I'm trying to figure out why it works with the brackets around $args. Without it, I don't get the values.
sub random_dice{
my ($args) = @_;
my $number_of_rolls = $args->{number_of_rolls} || 6;
...
}
# I don't understand why it works with the brackets around $args
my $r = random_dice({number_of_rolls=>5});