Acme-Numbers

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

v1.2  Fri Aug 17 2012 10:11:25 PDT
- Fix test failures under Test::Simple 0.95_02 (thanks Slaven Rezic)

v1.1  Sun 27 Jan 2008 20:28:38 GMT
- Fix a couple of stupid coverage and debug errors

v1.0  Sun 27 Jan 2008 17:39:00 GMT
- Initial release

lib/Acme/Numbers.pm  view on Meta::CPAN

}

sub AUTOLOAD {
    my $self   = shift;
    my $method = $AUTOLOAD;
    $method    =~ s/.*://;   # strip fully-qualified portion
    my $val;
    # nasty override - we should probably have a 
    # generic major or minor currency indicator
    # if we could store and propogate the currency
    # then we could also throw errors at mismatched 
    # units e.g five.pounds.and.fifty.cents
    # but maybe also print out the correct sigil
    # e.g $5.50
    $method = 'pounds' if $method eq 'dollars';
    $method = 'pence'  if $method eq 'cents';

    # dummy methods
    if ($method eq 'and' || $method =~ m!^p!) {
        $val = $self->new(0, $method) 
    } else {



( run in 0.825 second using v1.01-cache-2.11-cpan-65fba6d93b7 )