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