Re: Inflate/deflate to formatted text

[prev] [thread] [next] [Date index for 2004/09/14]

From: Perrin Harkins
Subject: Re: Inflate/deflate to formatted text
Date: 19:53 on 14 Sep 2004
On Tue, 2004-09-14 at 15:46, William McKee wrote:
> I have a field in my database which I would like to present in a
> formatted string when retrieved. It's not a date so the sample
> inflate/deflate code does not work. I have tried using an empty class
> when setting up the has_a relationship but CDBI complains. There is
> really no appropriate base class; I just need to do a sprintf on a value
> to get a better format. Is there a way to handle this without using a
> base class?

You have to inflate it an object if you want to use has_a.  You can
inflate it to an IO::Scalar object, or something simple of your own
making.  If that sounds like too much, just do the formatting somewhere
else when you read from the CDBI object.

- Perrin

Inflate/deflate to formatted text
William McKee 19:46 on 14 Sep 2004

Re: Inflate/deflate to formatted text
Perrin Harkins 19:53 on 14 Sep 2004

Re: Inflate/deflate to formatted text
Brian Webb 22:31 on 14 Sep 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52