You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by csross <cr...@hccs.com> on 2009/03/04 21:27:23 UTC

"Too many arguments for subroutine" after convert to mod_perl

I am converting some cgi scripts to enable them to run under mod_perl.  I
have one script that I defined as a package and reference it via the package
name in the calling program.  That eliminated my "undefined subroutine"
errors but I just got one I do not know.  Any help would be appreciated.

I am getting the error 

[error] Too many arguments for packagesubs::getResultSet at
/usr/local/apache2/cgi-bin2/launch_frm.cgi line 209, near "$strSQL)"\n

In my calling program I have 

$sth = packagesubs::getResultSet($strSQL);  

In the called program I have 

package packagesubs;

sub getResultSet()
{
$sqlQuery=$_[0];
$sth = $dbh->prepare($sqlQuery);
$sth->execute || die "Can't prepare statement: $DBI::errstr";
return $sth;
}

-- 
View this message in context: http://www.nabble.com/%22Too-many-arguments-for-subroutine%22-after-convert-to-mod_perl-tp22338572p22338572.html
Sent from the mod_perl - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: "Too many arguments for subroutine" after convert to mod_perl

Posted by Torsten Foertsch <to...@gmx.net>.
On Wed 04 Mar 2009, csross wrote:
> I am converting some cgi scripts to enable them to run under
> mod_perl.  I have one script that I defined as a package and
> reference it via the package name in the calling program.  That
> eliminated my "undefined subroutine" errors but I just got one I do
> not know.  Any help would be appreciated.
>
> I am getting the error
>
> [error] Too many arguments for packagesubs::getResultSet at
> /usr/local/apache2/cgi-bin2/launch_frm.cgi line 209, near
> "$strSQL)"\n

First of all, this is the wrong list for the question. The "dev" list is 
for developing modperl itself. Use the users list 
modperl@perl.apache.org instead.

> In my calling program I have
>
> $sth = packagesubs::getResultSet($strSQL);  
>
> In the called program I have
>
> package packagesubs;
>
> sub getResultSet()

And secondly, the modperl users isn't the right auditorium either for 
this particular question since it's not modperl-related:

$ perl -e 'sub x(){} x(1)'
Too many arguments for main::x at -e line 1, at end of line
Execution of -e aborted due to compilation errors.

Take your copy of "Programming Perl" and reread the part about 
prototypes.

Torsten

-- 
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org