IF: if($current && $resistance) { if($current =~ s/mA//i) { $current /= 1000; } else { } } else { print "Those aren't valid answers.\n"; print "Please type that again, will ya?\n"; print "Type the current of the circuit.\n"; print "Add mA at the end of your answer\n"; print "if your answer is in milliAmps.\n"; $current = ; chomp $current; print "Now type the resistance of the circuit.\n"; $resistance = ; chomp $resistance; goto IF; }