Help for this page

Select Code to Download


  1. or download this
    my $source = Sub::ParamObject->new({
        selector => sub {
    ...
                and $_[1] =~ qr!^https?://!i
        },
    });
    
  2. or download this
    my $source = Sub::ParamObject->new({
        selector => [ qr/^(filename|url)$/, sub { @{$_[0]}{qw(filename url
    +)} and !exists $self->{$_[1]} }, ],
        filename => [ qr/^\w+$/, sub { !exists $_[0]->{filename} or $_[0]-
    +>{selector} eq 'url' }, ],
        url => [ qr!^https?://!i, sub { !exists $_[0]->{filename} or $_[0]
    +->{selector} eq 'url' }, ],
    });
    
  3. or download this
    my $source = Sub::ParamObject->new(test => {
        selector => {
    ...
            $_[0]->add_check(selector => need_url => sub { $_[1] ne 'filen
    +ame' });
        },
    });