Help for this page

Select Code to Download


  1. or download this
    package MyClass;
    use Moose;
    ...
        is => 'rw',
        isa => subtype('Str', where { /^[\w-]+$/ }),
    );
    
  2. or download this
    package MyClass;
    use Moose;
    ...
        is => 'rw',
        isa => 'StringWithDashes'
    );
    
  3. or download this
    use Email::Valid;
    
    ...
        is => 'rw',
        isa => subtype('Str', where { Email::Valid->address($_) })
    );