[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Bad subroutine!



On Thu, May 27, 1999 at 04:52:45PM -0400, Allan Greenier wrote:
> Greetings,
> This one's driving me crazy and I know the answer must be simple.
> I've got this sub:
> 
> sub removeLeadingTrailingDoubleSpaces(){
                                       ^^

You have declared this subroutine with a prototype of zero arguments.

> $string = shift;
            ^^^^^

Then you do something with an argument.


> $searchItem = removeLeadingTrailingDoubleSpaces($searchItem);

And you call it with an argument.


> I get the following error:
> 
> # Too many arguments for main::removeLeadingTrailingDoubleSpaces, near
> "$searchItem)"

You certainly do.  :)


Ronald

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org