Tom Christiansen wrote:
> 
> >    print "Today's weather will be $weather->temp degrees and sunny.";
> 
> So, the -> operator is supposed to get expanded in dq strings, eh?

It already does, or at least appears to to users:

    print "Today's weather will be $weather->{temp} degrees and sunny.";
    print "Today's weather will be $weather->[0] degrees and sunny.";
 
> Isn't it inconsistent to do this?

I think it's far more inconsistent to have the above work but not have
methods interpolate. And yes, I realize they're different thingies but
they're very close syntactically and cognitively, especially for data
access (which is really what we're talking about here).

I've always found it quite surprising and cumbersome to have to do this:

    print "Today's weather will be ", $weather->temp, " degrees and
sunny.";

When the above two work fine.

-Nate

Reply via email to