Group
Extension

Matches 1354

perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DROLSKY, 2025; MetaCPAN )
perl/pod/perl5101delta.pod ( view source; MetaCPAN )
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
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DROLSKY, 2025; MetaCPAN )
perl/Porting/checkpodencoding.pl ( view source; MetaCPAN )
 # 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) {
 
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DOM, 2025; MetaCPAN )
perl/pod/perlfaq4.pod ( view source; MetaCPAN )
 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
AsposeCellsCloud-CellsApi ( A/AS/ASPOSE/AsposeCellsCloud-CellsApi-25.10.tar.gz, ASPOSE, 2025; MetaCPAN )
AsposeCellsCloud-CellsApi/lib/AsposeCellsCloud/Role/AutoDoc.pm ( view source; MetaCPAN )
                               ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
                                 $role_reqs
.

	format INHERIT_POD =
=head1 NAME

@*
$mycl
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
                                                               $handles
.

	format ATTR_NARROW
        $handles
             ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
             $handles

.
	format ATTRHEAD_POD =
=head1 ATTRIBUTES

.
	format ATTR_POD =

PDK-Utils ( C/CA/CARELINE/PDK-Utils-0.005.tar.gz, CARELINE, 2025; MetaCPAN )
PDK-Utils/lib/PDK/Utils/Set.pm ( view source; MetaCPAN )
$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))
WebService-Fastly ( F/FA/FASTLY/WebService-Fastly-12.00.tar.gz, FASTLY, 2025; MetaCPAN )
WebService-Fastly/lib/WebService/Fastly/Role/AutoDoc.pm ( view source; MetaCPAN )
                               ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
                                 $role_reqs
.

    format INHERIT_POD =
=head1 NAME

@*
$myclass

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
                                                               $handles
.

    format ATTR_NARROW 
         $handles
             ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
             $handles

.
    format ATTRHEAD_POD =
=head1 ATTRIBUTES

.
    format ATTR_POD =

=he
Unix-Passwd-File ( P/PE/PERLANCAR/Unix-Passwd-File-0.251.tar.gz, PERLANCAR, 2020; MetaCPAN )
Unix-Passwd-File/lib/Unix/Passwd/File.pm ( view source; MetaCPAN )
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"]
        
Regexp-Common-Markdown ( J/JD/JDEGUEST/Regexp-Common-Markdown-v0.1.8.tar.gz, JDEGUEST, 2025; MetaCPAN )
Regexp-Common-Markdown/lib/Regexp/Common/Markdown.pm ( view source; MetaCPAN )
-----------------------------------
        # 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
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DROLSKY, 2025; MetaCPAN )
perl/pod/perlform.pod ( view source; MetaCPAN )
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 
Syntax-Infix-Smartmatch ( L/LE/LEONT/Syntax-Infix-Smartmatch-0.011.tar.gz, LEONT, 2025; MetaCPAN )
Syntax-Infix-Smartmatch/lib/Syntax/Infix/Smartmatch.xs ( view source; MetaCPAN )
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* 
Acme-CPANModules-SmartMatch ( P/PE/PERLANCAR/Acme-CPANModules-SmartMatch-0.007.tar.gz, PERLANCAR, 2024; MetaCPAN )
Acme-CPANModules-SmartMatch/lib/Acme/CPANModules/SmartMatch.pm ( view source; MetaCPAN )
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
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DROLSKY, 2025; MetaCPAN )
perl/pod/perl5140delta.pod ( view source; MetaCPAN )
pty list if the block was exited by C<break>.  Thus you
can now write:

    my $type = do {
     given ($num) {
      break     when undef;
      "integer" when /^[+-]?[0-9]+$/;
      "float"   when /
e operators is used in
an unparenthesised argument:

  < > <= >= lt gt le ge
  == != <=> eq ne cmp ~~
  &
  | ^
  &&
  || //
  .. ...
  ?:
  = += -= *= etc.
  , =>

=head3 Smart-matching against array
 resulted in a successful match:

    my @a = qw(a y0 z);
    my @b = qw(a x0 z);
    @a[0 .. $#b] ~~ @b;

This odd behaviour has now been fixed [perl #77468].

=head3 Negation treats strings differen
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DROLSKY, 2025; MetaCPAN )
perl/lib/overload.pm ( view source; MetaCPAN )
            => "-X",
    dereferencing       => '${} @{} %{} &{} *{}',
    matching            => '~~',
    special             => 'nomethod fallback =',
);

my %ops_seen;
for $category (keys %ops) {
s	  => '<>',
 filetest         => '-X',
 dereferencing	  => '${} @{} %{} &{} *{}',
 matching	  => '~~',
 special	  => 'nomethod fallback ='

Most of the overloadable operators map one-to-one to these 
oad was introduced in Perl 5.12.

=item * I<Matching>

The key C<"~~"> allows you to override the smart matching logic used by
the C<~~> operator and the switch construct (C<given>/C<when>).  See
L<pe
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DOM, 2025; MetaCPAN )
perl/lib/Pod/Functions.pm ( view source; MetaCPAN )
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    $typedesc 
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    $typedesc 
 ~~  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DROLSKY, 2025; MetaCPAN )
perl/pod/perl5160delta.pod ( view source; MetaCPAN )

=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
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DOM, 2025; MetaCPAN )
perl/dist/Storable/t/freeze.t ( view source; MetaCPAN )
#$a = 2; $a->[1] = undef;
        $b = thaw freeze $a;
        @a = map { ~~ exists $a->[$_] } 0 .. $#$a;
        @b = map { ~~ exists $b->[$_] } 0 .. $#$b;
        ok 20, "@a" eq "@b";
    ';
}
else 
perl ( E/EH/EHERMAN/perl-5.43.4.tar.gz, DROLSKY, 2025; MetaCPAN )
perl/install_lib.pl ( view source; MetaCPAN )
| $Is_NetWare);

    if ($p1 ne $p2) {
	my($dev1, $ino1, $dev2, $ino2);
	($dev1, $ino1) = stat($p1);
	($dev2, $ino2) = stat($p2);
	($dev1 ~~ $dev2 && $ino1 ~~ $ino2);
    }
    else {
	1;
    }
}

1;
Markdown-Parser ( J/JD/JDEGUEST/Markdown-Parser-v0.5.1.tar.gz, JDEGUEST, 2025; MetaCPAN )
Markdown-Parser/lib/Markdown/Parser/StrikeThrough.pm ( view source; MetaCPAN )
ft( @_ );
    my $str = $self->children->map(sub{ $_->as_markdown })->join( '' );
    return( "~~${str}~~" );
}

sub as_pod
{
    my $self = shift( @_ );
    my $str = $self->children->map(sub{ $_->as
Markdown::Parser> and inherits from L<Markdown::Parser::Element>

For example:

    ~~This whole sentence is wrong~~

=head1 METHODS

=head2 as_markdown

Returns a string representation of the strike-
Switch-Back ( D/DC/DCONWAY/Switch-Back-0.000005.tar.gz, DCONWAY, 2025; MetaCPAN )
Switch-Back/lib/Switch/Back.pm ( view source; MetaCPAN )
te @pure_statements;
    @pure_statements = ();
    state $VALIDATE_PURE_GIVEN = qr{
        \A  given (?<GIVEN>  (?<ws_post_kw>   $OWS    )  \(
                             (?<ws_pre_expr>  $OWS    )
    return !defined $left;
    }

    # 2. Objects on the RHS can't be handled (at all, because no ~~ overloading available)...
    croak 'Smart matching an object breaks encapsulation'
        if $ri
removed in this version of Perl

    use Switch::Back;   # But this module brings them back

    given ($some_value) {

        when (1)   { say 1; }

        when ('a') { say 'a'; continue; }

      
Crop ( O/OC/OCTAVIANI/Crop-0.1.27.tar.gz, OCTAVIANI, 2025; MetaCPAN )
Crop/lib/Crop/Object/Attr.pm ( view source; MetaCPAN )
y ($self, $type) = @_;
	
	given ($type) {
		when (STORED) { $self->{type} ~~ ATTR_STORED }
		when (CACHED) { $self->{type} ~~ ATTR_CACHED }
		when (KEY)    { $self->{type} ~~ ATTR_KEY    }
		when (ANY

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.