<div class="gmail_quote">Hi Shlomi,<div><br></div><div>Thanks for the lead. I didn't end up using <span>Language::Farnsworth but rather a combination of Math::Units and Physics::Unit, which both do something like multiplying units. </span></div>

<div><span><br></span></div><div><span>The big task for me though was simply to accept a string with a unit and via coercion end up with a number in the appropriate unit. It certainly isn't in a final form, and no docs yet, but my repo at </span><a href="https://github.com/jberger/MooseX-Types-NumUnit" target="_blank">https://github.com/jberger/MooseX-Types-NumUnit</a> has my current work on the matter.</div>

<div><br></div><div>My pride and joy is that:</div><div><br></div><div><div>package MyTest;</div><div><br></div><div>use Moose;</div><div>use MooseX::Types::NumUnit qw/num_of_unit/;</div><div><br></div><div>#$MooseX::Types::NumUnit::Verbose = 1;</div>

<div><br></div><div>has 'speed' => ( isa => num_of_unit('ft / hour'), is => 'rw', required => 1 );</div><div><br></div><div>no Moose;</div><div>__PACKAGE__->meta->make_immutable;</div>

<div><br></div><div>my $test = MyTest->new( speed => '2 m / s' );</div><div><br></div><div>print $test->speed, "\n";</div></div><div>__END__</div><div><br></div><div>prints: 23622.0472440945</div>

<div><br></div><div>Cheers,</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Joel Berger</div></font></span><div class="HOEnZb"><div class="h5"><div><br></div><div><br><div class="gmail_quote">On Thu, Dec 8, 2011 at 10:28 AM, Shlomi Fish <span dir="ltr"><<a href="mailto:shlomif@shlomifish.org" target="_blank">shlomif@shlomifish.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div><br>
On Thu, 8 Dec 2011 09:19:05 -0600<br>
Joel Berger <<a href="mailto:joel.a.berger@gmail.com" target="_blank">joel.a.berger@gmail.com</a>> wrote:<br>
<br>
> Ok so while there is still only a small response, those who have responded<br>
> are still excited to meet, so:<br>
><br>
> We Are Still On!<br>
><br>
> Anyone, of course, will be welcome to come join us. We will be at Dugan's,<br>
> just north of Adams on Halsted. As I metion in the meetup description,<br>
> during happy hour (which I believe is 5-7) they have some free food, other<br>
> than that there is no food at Dugans, so plan accordingly. I expect I will<br>
> be there a little early so as to partake. The official start time for the<br>
> meetup is 7:00.<br>
><br>
> Some topics which may be discussed:<br>
><br>
> - Physical units as Moose types (for unit conversion via coersion)<br>
<br>
</div>You may wish to look into Language::Farnsworth :<br>
<br>
<a href="http://search.cpan.org/dist/Language-Farnsworth/" target="_blank">http://search.cpan.org/dist/Language-Farnsworth/</a><br>
<br>
It has support for unit conversion and unit mathematics, including that of<br>
aggregate units. So you can divide 100 miles by 2 hours and get the result in<br>
metres/second, or much more funky stuff. We've been enjoying the "farnsworth"<br>
bot on some Perl channels on Freenode.<br>
<br>
Regards,<br>
<br>
        Shlomi Fish<br>
<div><div><br>
<br>
<br>
> - The Zoidberg Perl Shell<br>
> - David has a lead on a jit for Perl5!<br>
><br>
> So plenty of fun for all; hope to see you there!<br>
><br>
> Joel Berger<br>
> <a href="mailto:joel.a.berger@gmail.com" target="_blank">joel.a.berger@gmail.com</a><br>
<br>
</div></div><span><font color="#888888">--<br>
-----------------------------------------------------------------<br>
Shlomi Fish       <a href="http://www.shlomifish.org/" target="_blank">http://www.shlomifish.org/</a><br>
Stop Using MSIE - <a href="http://www.shlomifish.org/no-ie/" target="_blank">http://www.shlomifish.org/no-ie/</a><br>
<br>
“THERE IS NO JUSTICE. THERE’S ONLY ME.“<br>
    — Death in Terry Pratchett's Mort<br>
<br>
Please reply to list if it's a mailing list post - <a href="http://shlom.in/reply" target="_blank">http://shlom.in/reply</a> .<br>
</font></span></blockquote></div><br></div>
</div></div></div><br>