Data-InputMonster

 view release on metacpan or  search on metacpan

lib/Data/InputMonster.pm  view on Meta::CPAN

sub new {
  my ($class, $arg) = @_;
  
  Carp::confess("illegal parameters to Data::InputMonster constructor")
    unless $arg and (keys %$arg == 1) and exists $arg->{fields};

  my $fields = $arg->{fields};

  $class->_assert_field_spec_ok($_) for values %$fields;

  bless { fields => $fields } => $class;
}

sub _assert_field_spec_ok {
  my ($self, $spec) = @_;

  Carp::confess("illegal or missing sources")
    unless $spec->{sources} and ref $spec->{sources} eq 'ARRAY';

  Carp::confess("if given, filter must be a coderef")
    if $spec->{filter} and ref $spec->{filter} ne 'CODE';

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

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