sub reduce_hp { my ($hp) = @_; $hp -= int(rand(21)); return $hp; } my $char_hp = 400; $char_hp = reduce_hp($char_hp); print("Character now has $char_hp hp\n");