Re: trouble with stringify

[prev] [thread] [next] [Date index for 2005/04/25]

From: merlyn (Randal L. Schwartz)
Subject: Re: trouble with stringify
Date: 05:15 on 25 Apr 2005
>>>>> "Perrin" == Perrin Harkins <perrin@xxxx.xxx> writes:

Perrin> You may be running into a slightly different version of this bug than I
Perrin> saw, but I suspect it's the same thing.  In my case, I would create a
Perrin> new object whose definition includes a has_a on part of its primary key,
Perrin> and then calls to the accessor with the has_a would give me the string
Perrin> rather than the object.  Undef'ing the object and re-fetching it would
Perrin> make the has_a work, but I couldn't take that chance of forgetting to do
Perrin> that so I just got rid of the has_a and made my own accessor for the
Perrin> linked object.

Ahh, but it's so convenient to simply say:

        [% FOR role IN actor.roles %]
        [% role.film %] (released in [% role.film.year %])
        [% END %]

The first gets the stringified film.  The second uses role.film
in its object sense to get the rest of the data for that film:
in this case, the year.

        -- 
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

(message missing)

trouble with stringify
merlyn (Randal L. Schwartz) 23:56 on 24 Apr 2005

Re: trouble with stringify
Perrin Harkins 01:09 on 25 Apr 2005

Re: trouble with stringify
merlyn (Randal L. Schwartz) 04:53 on 25 Apr 2005

Re: trouble with stringify
Perrin Harkins 05:10 on 25 Apr 2005

Re: trouble with stringify
merlyn (Randal L. Schwartz) 05:15 on 25 Apr 2005

Re: trouble with stringify
Perrin Harkins 05:24 on 25 Apr 2005

Re: trouble with stringify
merlyn (Randal L. Schwartz) 05:26 on 25 Apr 2005

Re: trouble with stringify
Tony Bowden 08:46 on 25 Apr 2005

Generated at 09:29 on 27 Apr 2005 by mariachi v0.52