Re: Overloading

2001-06-03 Thread Richard Hulse
Jeff, I have sussed it. Page 353 of the Camel book says of the += operator "the result is assigned to the left hand operand..." The result of the '+ 1' method call is that a number in $self is modified. The last line of the method is: $self->{_time_offset} = $offset; ...which is fine until t

Re: Overloading

2001-06-03 Thread Richard Hulse
Hi Jeff, Thanks. According to the man pages Perl automatically substitutes + for += without fallback. The problem is that even if I substitute the += method for + it still doesn't work. Somehow $obj gets turned into the offset amount. I have spent several hours with the debugger trying to fin

Re: Overloading

2001-06-03 Thread Jeff Pinyan
On Jun 3, Richard Hulse said: >I have a module which overloads a few operators > >snippet: >use overload > "+" => \&addoffset, > "-" => \&subtractoffset, > q("") => \&printit; > >Even if I allow Perl to magically make the += happen for me it still does >the same (wrong) thing. Are y