Re: Inflate/deflate to formatted text
[prev]
[thread]
[next]
[Date index for 2004/09/14]
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
|
|
Re: Inflate/deflate to formatted text
Perrin Harkins 19:53 on 14 Sep 2004
|