Hey Rob,

Yes - I've had reasonable success with 'use overload'.
The particular error you've quoted doesn't ring any bells for me, so it's probably best if you can provide some (minimal) code that causes the error.
Attached is my simple test program. Maybe I read the tutorial the wrong way, but that's how I interpreted it...

The problem with the code lies in line 25. Error is:
Operation """": no method found, argument in overloaded package MyObj at test.pl line 25.

Please advise. Thanks.
use strict;
use warnings;

$|=1;
my $a = MyObj->new;
my $b = MyObj->new;
print $a + $b;

package MyObj;
use strict;
use warnings;
use overload
        '+' => 'MyAdd';

sub new
{
        my $class = shift;
        
        return bless {},$class;
}

sub MyAdd
{
        my ($a,$b) = @_;
        print ''.$b;
        return 1;
}
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to