Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Exploring Type::Tiny Part 5: match_on_type

by tobyink (Canon)
on Aug 19, 2018 at 18:41 UTC ( [id://1220653]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
       use Types::Standard qw( is_ArrayRef is_HashRef );
       use Carp qw( croak );
       
    ...
             croak "Could not grok data";
          }
       }
    
  2. or download this
       use Types::Standard qw( ArrayRef HashRef Any );
       use Type::Utils qw( match_on_type );
       use Carp qw( croak );
    ...
             HashRef,  sub { $self->_process_value($_) for values %$data }
    +,
             Any,      sub { croak "Could not grok data" };
       }
    
  3. or download this
       use Types::Standard qw( ArrayRef HashRef Any );
       use Type::Utils qw( compile_match_on_type );
       use Carp qw( croak );
    ...
             Any,      sub { croak "Could not grok data" };
          $matcher->($data);
       }
    
  4. or download this
       use Types::Standard qw( ArrayRef HashRef Any );
       use Type::Utils qw( compile_match_on_type );
       use Carp qw( croak );
    ...
             Any,      sub { croak "Could not grok data" };
          $matcher->($data, $self);
       }
    
  5. or download this
       use Types::Standard qw( ArrayRef HashRef Any );
       use Type::Utils qw( compile_match_on_type );
       use Carp qw();
    ...
             Any,      q{ Carp::croak("Could not grok data") };
          $matcher->($data, $self);
       }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://1220653]
Approved by marto
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found