http://www.perlmonks.org?node_id=875371


in reply to logic problem with perl game

You should consider changing
{ $shield=param('shield'); $correctryhm=param('correctryhm'); $response=param('response'); $win=param('win'); $win=$win+1; }

to

{ $shield = param( 'shield' ); process(); } # .... sub process { $correctryhm = param('correctryhm'); $response = param('response'); $win = param('win'); $win=$win+1; }

This will reduce the size of your code.