Type Constraint Unions
Sometimes just one type is not enough ...
subtype 'IO::Handle'
=> as 'Object'
=> where { $_->isa('IO::Handle') };
has 'template' => (
is => 'ro',
isa => 'Str | ScalarRef | FileHandle | IO::Handle',
);
- Taken from Excel::Template::Plus