r term is expected
# next.
if ( $rsquare_bracket_type->[$square_bracket_depth] eq '~~' ) {
$tok = $rsquare_bracket_type->[$square_bracket_depth];
}
if ( $s
'||=' => undef,
## '//=' => undef,
## '~' => undef,
## '~~' => undef,
## '!~~' => undef,
};
# ---------------------------------------------------------
|| >= != mm *= => .. !~ == && |= .= pp -= =~ += <= %= ^= x= ~~ ** << /=
&= // >> ~. &. |. ^.
... **= <<= >>= &&= ||= //= <=> !~~ &.= |.= ^.= <<~
#;
push @q, ',';
push @q, '('
# Test cases
$file ~~ m[Pod-Simple/t];
my ($in_pod, $has_encoding, @non_ascii);
FILE: while (my $line = <$fh>) {
chomp $line;
if ($line ~~ /^=[a-z]+/) {
if ($in_pod) {
if ($line ~~ /^=encoding (\S+)/) {
$has_encoding = 1;
last FILE;
} elsif ($line ~~ /[^[:ascii:]]/) {
my $enc
"$encoding->{Name}?" : 'unknown!'),
};
}
}
if ($line ~~ /^=cut/) {
$in_pod = 0;
}
}
if (@non_ascii and not $has_encoding) {
] = $retfile;
print RETBLOCK "$retfile\n";
if ( not ($retfile ~~ @retcases ) )
{
push ( @retcases, $retfile );
} @miditers = Sim::OPT::washn( @miditers );
if ( not ( $retfile ~~ @{ $notecases[ $countcase ][ $countblock ][ $counttool ][ $countinstance ] } ) )
es = uniq( @retcases );
my $retfile = $resfile;
if ( not ($retfile ~~ @retcases ) )
{
push ( @retcases, $retfile );
ed.
=head2 Smart match changes
=head3 Changes to type-based dispatch
The smart match operator C<~~> is no longer commutative. The behaviour of
a smart match now depends primarily on the type of its
t like the other code references (even if they
choose to ignore it).
=item *
C<%hash ~~ sub {}> and C<@array ~~ sub {}> now test that the subroutine
returns a true value for each key of the hash (or
are no longer
treated specially when appearing on the left of the C<~~> operator,
but like any vulgar scalar.
=item *
C<undef ~~ %hash> is always false (since C<undef> can't be a key in a
hash). No
es.
=head2 Smart match changes
=head3 Changes to type-based dispatch
The smart match operator C<~~> is no longer commutative. The behaviour of
a smart match now depends primarily on the type of its
t like the other code references (even if they
choose to ignore it).
=item *
C<%hash ~~ sub {}> and C<@array ~~ sub {}> now test that the subroutine
returns a true value for each key of the hash (or
are no longer
treated specially when appearing on the left of the C<~~> operator,
but like any vulgar scalar.
=item *
C<undef ~~ %hash> is always false (since C<undef> can't be a key in a
hash). No
in in
subsequent 5.10 releases.
=head3 Changes to type-based dispatch
The smart match operator C<~~> is no longer commutative. The behaviour of
a smart match now depends primarily on the type of its
t like the other code references (even if they
choose to ignore it).
=item *
C<%hash ~~ sub {}> and C<@array ~~ sub {}> now test that the subroutine
returns a true value for each key of the hash (or
are no longer
treated specially when appearing on the left of the C<~~> operator,
but like any vulgar scalar.
=item *
C<undef ~~ %hash> is always false (since C<undef> can't be a key in a
hash). No
blockelts_r };
foreach my $key ( sort ( keys %varns ) )
{
if ( not( $key ~~ @blockelts ) )
{
$varns{$key} = 1;
}
}
return( %va
{
foreach my $key ( sort ( keys( %varnums ) ) )
{
if ( not( $key ~~ @blockelts ) )
{
$modhs{$key} = $varnums{$key};
$torecover
foreach my $instance ( @{ $vehicles{cumulateall} } )
{
if ( $instance->{is} ~~ @reds )
{
my @instancees;
push( @instancees, $instance );
esfile, $shortflfile );
#if ( ( $dowhat{simulate} eq "y")
# and ( ( ( not ( $to{cleanto} ~~ ( @trieds ) ) ) or ( not ( $precious eq "" ) ) )
# or ( ( $gaproc eq "yes" ) and ( $fire eq
";
if ( ( not ( $resfile ~~ @simcases ) ) and ( not ( -e $resfile ) ) and ( $dowhat{simulate} eq "y")
and ( not ( $to{cleanto} ~~ ( @trieds ) ) ) )
{
print SIMBLOCK "$resfile\n";
}
if ( ( not ( $resfile ~~ @retcases ) ) and ( not ( -e $resfile ) ) )
{
push ( @simcases, $res
item is
contained in an array or a hash:
use 5.010;
if( $item ~~ @array )
{
say "The array contains $item"
}
if( $item ~~ %hash )
{
say "The hash contains $item"
}
With earlier ver
answer
with the least amount of work:
use 5.010;
if( @array1 ~~ @array2 )
{
say "The arrays are the same";
}
if( %hash1 ~~ %hash2 ) # doesn't check values!
{
say "The hash keys are th
ь case по имени
sub tryFromName {
my ($cls, $name) = @_;
my ($case) = grep { $_->{name} ~~ $name } $cls->cases;
$case
}
# Получить case по значению c исключение
по значению
sub tryFromValue {
my ($cls, $value) = @_;
my ($case) = grep { $_->{value} ~~ $value } $cls->cases;
$case
}
# Получить case по значению c исключени
по значению
sub tryFromStash {
my ($cls, $stash) = @_;
my ($case) = grep { $_->{stash} ~~ $stash } $cls->cases;
$case
}
# Получить case по псевдониму c исключе
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
$role_reqs
.
format INHERIT_POD =
=head1 NAME
@*
$myclass
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
$handles
.
format ATTR_NARROW
$handles
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
$handles
.
format ATTRHEAD_POD =
=head1 ATTRIBUTES
.
format ATTR_POD =
=he
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
$role_reqs
.
format INHERIT_POD =
=head1 NAME
@*
$mycl
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
$handles
.
format ATTR_NARROW
$handles
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
$handles
.
format ATTRHEAD_POD =
=head1 ATTRIBUTES
.
format ATTR_POD =
$self->mins} ~~ @{$setObj->mins} and @{$self->maxs} ~~ @{$setObj->maxs});
}
# 判断两个集合是否不相等
sub notEqual {
my ($self, $setObj) = @_;
return !(@{$self->mins} ~~ @{$setObj->
mins} and @{$self->maxs} ~~ @{$setObj->maxs});
}
# 判断当前集合是否包含另一个集合(包含相等情况)
sub isContain {
my ($self, $setObj) = @_;
if ($self->isEqual($setObj))
ormat, picture line>
X<@> X<^> X<< < >> X<< | >> X<< > >> X<#> X<0> X<.> X<...>
X<@*> X<^*> X<~> X<~~>
@ start of regular field
^ start of special field
< pad character for left jus
ble width field for next line of a multi-line value
~ suppress line with all fields empty
~~ repeat line until all fields are exhausted
Each field in a picture line starts with either "@"
$text = "line 1\nline 2\nline 3";
format STDOUT =
Text: ^*
$text
~~ ^*
$text
.
Output:
Text: line 1
line 2
line
-----------------------------------
# 1) Ignore fenced code blocks (```lang … ``` or ~~~ … ~~~)
# We match them first, then (*SKIP)(*F) so the engine
# jumps past the
--------------------------------------------------
# 1) Fenced-code guard (```...``` or ~~~...~~~)
#---------------------------------------------------------
$MD_SKIP_FENCED
cks with backticks, except the extended version uses tilde characters.
For example:
~~~
<div>
~~~
You can see example of this regular expression along with test units here: L<https://re
up; $i++) {
my @mm = split /,/, $group->[$i][3];
next unless $user ~~ @mm || $group->[$i][0] eq $user;
if (!$detail) {
push @rows, $
return undef unless $res->[0] == 200;
my @mm = split /,/, $res->[2]{members};
return $user ~~ @mm ? 1:0;
}
$SPEC{get_max_uid} = {
v => 1.1,
summary => 'Get maximum UID used',
args
for ($min_gid .. $max_gid) {
do { $gid = $_; last } unless $_ ~~ @gids;
}
return [412, "Can't find available GID"]
opy(d);
}
else
d = &PL_sv_undef;
assert(e);
if (SvGMAGICAL(e))
e = sv_mortalcopy(e);
/* ~~ undef */
if (!SvOK(e)) {
return !SvOK(d);
}
else if (SvROK(e)) {
/* First of all, handle ov
rt_amg, AMGf_noleft);
#else
HV* stash = SvSTASH(SvRV(e));
GV* gv = gv_fetchmeth_pvn(stash, "(~~", 3, -1, 0);
if (gv) {
UNOP myop = {
.op_flags = OPf_STACKED | OPf_WANT_SCALAR,
K;
POPSTACK;
CATCH_SET(oldcatch);
}
#endif
if (sv)
return SvTRUEx(sv);
}
/* ~~ qr// */
if (SvTYPE(SvRV(e)) == SVt_REGEXP) {
dSP;
REGEXP* re = (REGEXP*)SvRV(e);
PMOP*
007'; # VERSION
my $text = <<'MARKDOWN';
**About smart match**
Smart matching, via the operator `~~`, was introduced in perl 5.10 (released
2007). It's inspired by Perl 6 (now called Raku)'s `given/
) more. Interesting things begin when the left/right hand
side is an array/hash/code/object. `$str ~~ @ary_of_strs`, probably the most
common use-case for smart matching, can do value-in-array checkin
lent
to `grep { $str eq $_ } @ary_of_strs` but with short-circuiting capability. Then
there's `$re ~~ @ary_of_strs` which can perform regex matching over the elements
of array. Now what about when the
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$typedesc
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$typedesc
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
=over
=item *
C<~~> now correctly handles the precedence of Any~~Object, and is not tricked
by an overloaded object on the left-hand side.
=item *
In Perl 5.14.0, C<$tainted ~~ @array> stopped wo