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.

#!/usr/bin/perl
print "content-type: text/html \n\n";

&fname;

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

    }

    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 .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.