in reply to Random Numbers?

Add the following to the top of your script.
use strict; use warnings;
The problem will be self-evident.

For those who can't wait ...

Your my $dmg = ... is scoping $dmg within the if-block. By the time you get to $wizard-=$dmg;, it's back to undef.

  • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
  • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"