Hi I am struggling learning perl and everytime I try to enter stuff in at runtime I keep getting a 1 returned. I dont get it. please can you explain to me what I am doing wrong.

print "content-type: text/html \n\n";


print "\n totals are out of 140 \n";
sub fname
    return "enter in up to 10 firstnames: \n";
    for ($i=0; $i < 2; $i++)


    return "these are the firstnames:".@name;

you are returning from the &fname as soon as you enter the function. So your function is not executing till end of the function.
You have two return statements in your function. Learn how to write sub-routines in perl perldoc perlsub .