Fwd: Re: What's the best approach for translating an attribute upon creation?

2010-02-26 Thread Steve
This method works great! I was very close to getting coercion to work, but somehow my substitution returned '2' every time. Thanks all for the help Steve Something along the lines of the following should work: package Types; use Moose::Util::TypeConstraints; # note, need a type here,

Re: Fwd: Re: What's the best approach for translating an attribute upon creation?

2010-02-26 Thread Hans Dieter Pearcey
Excerpts from Steve's message of Fri Feb 26 09:50:51 -0500 2010: This method works great! I was very close to getting coercion to work, but somehow my substitution returned '2' every time. Thanks all for the help You were doing via { s/-//g } instead of via { s/-//g; $_ }, so you were

Fwd: Fwd: Re: What's the best approach for translating an attribute upon creation?

2010-02-26 Thread Steve
I've moved on to a slightly more complex situation. The same phone call record contains two different date fields. One is a string like 'Jan 21, 2010' (incidentally, this date is repeated for each record, as it represents the end of the billing cycle), which I have successfully converted

Re: Fwd: Fwd: Re: What's the best approach for translating an attribute upon creation?

2010-02-26 Thread Jesse Luehrs
On Fri, Feb 26, 2010 at 12:52:44PM -0500, Steve wrote: I've moved on to a slightly more complex situation. The same phone call record contains two different date fields. One is a string like 'Jan 21, 2010' (incidentally, this date is repeated for each record, as it represents the end