View Single Post
  #5  
Old 12-22-2012, 02:09 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

yeah, lexical scope is your issue.

add the following to the top of your scripts and run them from a command line to catch things like what you are experiencing.

Code:
use warnings;
you should be using if/elsif/else in logic chains, not just if. it won't stop looking for matches after the first one is found otherwise.

you can also use the range (..) and smart match (~~) operators to see if a value is in a range of numbers like this:

Code:
if($rewardr ~~ [7..9]) {
    ...;
}
Reply With Quote