elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
_add_implicit_to_given_when_blocks {
# given($foo)
# when($bar) means when ($foo ~~ $bar)
# when(\@list) means when ($foo ~~ \@list)
# when(&func) means
n element
# if there is an "implicit smart match",
# insert << $_ ~~ >> at the beginning of the struct
my $given_child = $given->find('PPI::Structure::Given') or
$e eq '<=>' || $e eq 'cmp' || $e eq '!' || $e eq 'not' ||
$e eq '^' || $e eq 'xor' || $e eq '~~' || $e eq '..')) {
$is_implicit_smart_match = 0;
last;
} elsif (ref($e) =~ /::Regexp/) {
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
->{$rule->long} = []
if $rule->is_list && !defined $self->{'options'}->{$rule->long};
given($rule->type) {
when('s') {
}
when('i') {
$self->error('Argument "%s" to "-
$self->error('Value "%s" to argument "--%s" is invalid.', $arg, $rule->long)
unless $arg ~~ @{$rule->values || []};
}
}
if ($rule->is_list) {
if ('?' ne $rule->type) { ##
{
push @{$self->{'options'}->{$rule->long}}, $arg
unless ($rule->keep_unique && $arg ~~ @{$self->{'options'}->{$rule->long}});
}
$rule->mark_used;
next PROCESS_ARGUMENTS
|ARRAY
[0.26] Alternative host components which indicate the same virtual host. When
'AUTO' is given (the default since [0.28]), then L<generateAliases()|Any::Daemon::HTTP::VirtualHost/"Attributes">
f->_parse_num($n);
if ($unit ~~ $self->{_cache_w_second}) {
$args{seconds} = $n;
$self->{_uses_time} = 1;
} elsif ($unit ~~ $self->{_cache_w_minute}) {
uses_time} = 1;
} elsif ($unit ~~ $self->{_cache_w_hour}) {
$args{hours} = $n;
$self->{_uses_time} = 1;
} elsif ($unit ~~ $self->{_cache_w_day}) {
$
} elsif ($unit ~~ $self->{_cache_w_week}) {
$args{weeks} = $n;
} elsif ($unit ~~ $self->{_cache_w_month}) {
$args{months} = $n;
} elsif ($unit ~~ $self->{_cache
[$n+1],0,$ds) eq substr($x[$n],0,$ds); #hm
croak "Could not resolve, perhaps too little time given ($sec), iteratons=$n"
if $sec>0 and ($Resolve_time=time_fp()-$time_start)>$sec;
#warn "
# 0
print in( 'a', 'A','B','C','a'); # 1
I guess in perl 5.10 or perl 6 you could use the C<< ~~ >> operator instead.
=head2 in_num
Just as sub L</in>, but for numbers. Internally uses the perl
ts = grep { $_ eq 'foo' } @ary;
Another alternative is using smartmatch:
my $foo_exists = 'foo' ~~ @ary;
but smartmatch is now in experimental status and might be removed in the future.
Plus the a
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |