in reply to Re: Wrong number of arguments in methods call
in thread Wrong number of arguments in methods call

Removing the () from connect still gives me the same error. Also, calling connect with no arguments (well just the implied object) gives me the same error: 3 arguments received when 0 expected (although $ipaddr and $portno aren't reported, since they're not there anymore, just in case you thought I wasn't saving my script before I ran it).

I have a wiry brain/each eye a camera. Robot Tourist, by Ten Benson

  • Comment on Re: Re: Wrong number of arguments in methods call

Replies are listed 'Best First'.
Re: Re: Re: Wrong number of arguments in methods call
by tachyon (Chancellor) on May 09, 2002 at 12:08 UTC

    You must be doing something odd (as well as the incorrect () you added) so post your code in its entirity or copy this (works fine)

    my $foo = new Foo; $foo->connect('ip', 8080 ); package Foo; sub new { return bless {}, shift } sub connect { my $self = shift; my ($ip, $port) = @_; print "$self $ip $port"; }

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Thanks, I have discovered the problem is in the way I am using Win32::API, sorry. We need people like you to scan for cloaked Romulans, not have to worry about people like me.

      I have a wiry brain/each eye a camera. Robot Tourist, by Ten Benson