Michael G Schwern <[EMAIL PROTECTED]> writes: > > print "Today's weather will be $weather->temp degrees and sunny."; > >This does not DWIM. Instead of interpolating C<$weather->temp> as a method >call, it comes out as C<$weather.'->temp'> and is usually followed immediately >by the question "What does 'Weather=HASH(0x80d4174)->temp' mean??" Most >programmers learning OO Perl expect this to work and are surprised to find >that it does not. I think $xxxx-> is unlikely enough in a string that this is worth considering. > >Work arounds abound: print $weather->report; being the one I like best - avoids the un-meritted assumption it will be sunny ;-) -- Nick Ing-Simmons <[EMAIL PROTECTED]> Via, but not speaking for: Texas Instruments Ltd.
- RFC - Interpolation of method calls Michael G Schwern
- Re: RFC - Interpolation of method calls Michael Fowler
- Re: RFC - Interpolation of method calls Nathan Wiger
- Re: RFC - Interpolation of method calls Michael Fowler
- Re: RFC - Interpolation of method calls David L. Nicol
- Re: RFC - Interpolation of method calls Michael Fowler
- Re: RFC - Interpolation of method calls Tom Christiansen
- Re: RFC - Interpolation of method calls Nick Ing-Simmons
- Re: RFC - Interpolation of method calls Tom Christiansen
- Re: RFC - Interpolation of method calls Michael G Schwern
- Re: RFC - Interpolation of method calls Nathan Wiger
- Re: RFC - Interpolation of method calls Tom Christiansen
- Re: RFC - Interpolation of method calls Nathan Wiger
- Re: RFC - Interpolation of method ... Tom Christiansen
- Re: RFC - Interpolation of met... Michael G Schwern
- Re: RFC - Interpolation of... Tom Christiansen
- Re: RFC - Interpolation of... Michael G Schwern
- Re: RFC - Interpolation of... Tom Christiansen