Leave off the parentheses. Prototypes are generally not needed with Perl.
The ampersand is the old way of calling Perl subs. Don't use it for
modern Perl code unless you know what it does. Read "perldoc perlsub"
$count++;
print "<br>The Count: $count";
print FILEOUT "$count";
Quoting $count is unnecessary; read "perldoc -q quoting."
sub menu1()
{
print "<a href=testio.pl?cmd=testio>Testio<a>";
}
my $s = param('cmd') || $ARGV[0];
switch($s)
{
case "testio" { testio() }
else { menu1() }
}
Invoking testio.pl without a parameter resets the counter on my system.
Perhaps that was intended.
Thanks for the references. I'm studying them in detail. Before using
strict and warning I used to always call the subroutines without the
ampersand and parentheses. When I got the bareword not allowed using
strict, I kind of went overboard to avoid errors. But I'll study the
references and clean up my code to use what's required in each
instance.
The resetting of count was incidental. I cut a part of my main from
my program that included enough to duplicate what I did throughout to
get an opinion about the correctness.
I have another question on optimizing, but will start a new topic on
the new subject.
It'll take me a few hours to grab a small part and clean it up so that
it will work without the thousand lines of subroutines that are
intertwined with it.
The problem it takes an extremely long time to take 500 lines of colon
delineated data and update a 15,000 record MySQL table. It takes
between a minute and a half to three minutes.
-- L. James