use v5.10; use strict; use warnings; use Types::Standard qw( ArrayRef Str Num Int ); my $arr = [ 1, 2, 3.3 ]; if ($arr ~~ ArrayRef[Int]) { say "ArrayRef of Int" } elsif ($arr ~~ ArrayRef[Num]) { say "ArrayRef of Num" } elsif ($arr ~~ ArrayRef[Str]) { say "ArrayRef of Str" }
In reply to Re: Best guess for data type
by tobyink
in thread Best guess for data type
by spiros
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |