you'll hear it eventually and get burned by it soon, so here it is:
use strict and use warnings. this will force you to declare all your variables. eventually, this will come in very handy. its better to get started early before you get seriously burned later on. some other notes:
you don't have to call srand. perl will do this for you.
the while loop can be turned into a for (1..8) loop. this will get rid of the $i control variable which does not do anything.