Hi Guys,

trying to get the following code to print each line where relevant....but it only 
prints the first statement "yes its one!"  even if the $variable is "5"....

$variable = $var

if ($variable == "1"){

print MAIL "yes its one!\n";

} elsif ($variable == "2"){

print MAIL "it is two!\n";

} elsif ($variable == "3"){

print MAIL "the number three.\n";

} elsif ($variable == "4"){

print MAIL "4 is on the cards.\n";

} elsif ($variable == "5"){

print MAIL "number 5 is alive.\n";

} elsif ($variable == "6"){

print MAIL "pick up sticks.\n";

} elsif ($variable == "7"){

print MAIL "go to heaven.\n";

} else {

print "this is not working\n";

}





any ideas where I might be going wrong?  I copied this direct out of my perl 
book....theoretically it should work right??

regards

Cat

Reply via email to