- or download this
use Types::Standard qw(is_ArrayRef is_HashRef);
if (is_ArrayRef($var)) {
...
elsif (is_HashRef($var)) {
...;
}
- or download this
use Types::Standard qw(ArrayRef HashRef);
if (ArrayRef->check($var)) {
...
elsif (HashRef->check($var)) {
...;
}
- or download this
use Types::Standard qw(assert_Object assert_ArrayRef);
sub process_data {
...
my $data = assert_ArrayRef( $_[1] );
...;
}
- or download this
use Types::Path::Tiny qw( to_Path );
my $path = to_Path($thing);
- or download this
use Types::Path::Tiny qw( assert_Path to_Path );
my $path = assert_Path( to_Path($thing) );
- or download this
if (is_ArrayRef[Int]($var)) {
...;
}
- or download this
use Types::Standard qw(ArrayRef Int);
BEGIN {
...
if (is_ArrayRef_of_Int($var)) {
...;
}