in reply to Temporarily disabling overloaded operations.
Also be careful about what you're blessing as you can't bless constants e.gsub foo::print { my $obj = overload::Strval($_[0]); print "$obj: @_[1 .. $#_]"; } my $o = bless [] => 'foo'; $o->print('some output'); __output__ foo=ARRAY(0x1012116c): some output
perl -e 'bless \1' Modification of a read-only value attempted at -e line 1.
_________
broquaint
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Temporarily disabling overloaded operations.
by BrowserUk (Patriarch) on Sep 15, 2003 at 08:32 UTC |