On Sep 22, Gupta, Sharad said: > package Foo; > use overload q("") => sub {return shift->{bar}}; > $s = bless{bar=>"hello"}, Foo; > print "$s\n" > >prints "hello".
Because you have overloaded "" for objects of class Foo. > package Foo; > use overload q("") => sub {return shift->{bar}}; > $s = bless{bar=>"hello"},Foo; > $wilma = "how r u"; > print "$wilma\n" > >prints "how r u". Because you have overloaded "" for objects of class Foo, but there is no object of class Foo in double quotes. If you want to intercept ALL quoted strings, you'll need to use overload::constant, but that becomes tricky business. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]