Data-BT-PhoneBill

 view release on metacpan or  search on metacpan

lib/Data/BT/PhoneBill.pm  view on Meta::CPAN

our @fields = qw(type installation line chargecard _date time destination 
    _number _duration rebate _cost);

for my $f (@fields) {
    no strict 'refs';
    *{$f} = sub { shift->{$f} };
}

sub new {
  my ($class, @data) = @_;
  bless { map { $fields[$_] => $data[$_] } 0..$#fields } => $class;
}

sub date {
  my @parts = split /\//, shift->_date;
  return Date::Simple->new(@parts[2,1,0]);
}

sub number {
  my $num = shift->_number;
  $num =~ s/\s+$//; $num;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.604 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )