Group
Extension

Matches 1424

perl ( E/EH/EHERMAN/perl-5.45.4.tar.gz, DOM, 2026; MetaCPAN )
perl/pod/perl5110delta.pod ( view source; MetaCPAN )
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
Type-Tiny ( T/TO/TOBYINK/Type-Tiny-2.008005.tar.gz, TOBYINK, 2025; MetaCPAN )
Type-Tiny/lib/Types/Standard.pm ( view source; MetaCPAN )
y::Package";
   \%h ~~ Tied;                   # true
   \%h ~~ Tied[ $My_Package ];    # true
   \%h ~~ Tied["My::Package"];    # true
   
   tie my $s, "Other::Package";
   \$s ~~ Tied;             
      # true
   $s  ~~ Tied;                   # false !!

If you need to check that something is specifically a reference to
a tied hash, use an intersection:

   use Types::Standard qw( Tied HashRef
hRef);
   
   tie my %h, "My::Package";
   tie my $s, "Other::Package";
   
   \%h ~~ $TiedHash;     # true
   \$s ~~ $TiedHash;     # false

=item *

B<< StrMatch[`a] >>

A string that matches a regu
WebService-Fastly ( F/FA/FASTLY/WebService-Fastly-16.00.tar.gz, FASTLY, 2026; 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
perl ( E/EH/EHERMAN/perl-5.45.4.tar.gz, DOM, 2026; 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
Type-Tiny ( T/TO/TOBYINK/Type-Tiny-2.008005.tar.gz, TOBYINK, 2025; MetaCPAN )
Type-Tiny/lib/Type/Tiny/Manual/NonOO.pod ( view source; MetaCPAN )
ngWithMoo3>.

=head2 Type::Tiny and Smart Match

Perl 5.10 introduced the smart match operator C<< ~~ >>, which has since
been deprecated because though the general idea is fairly sound, the details
w
qw( Str Int );
  
  given ( $value ) {
    when ( Int ) { ... }
    when ( Str ) { ... }
  }

This will do what you wanted:

  use Types::Standard qw( is_Str is_Int );
  
  given ( $value ) {
    when
Web-Simple ( E/ET/ETHER/Web-Simple-0.035.tar.gz, ETHER, 2026; MetaCPAN )
Web-Simple/lib/Web/Simple/AntiquatedPerl.pod ( view source; MetaCPAN )
Moose
  DBIx::Class
  ----
  Modern
  Perl?
  ----
  perl5
  v10
  ----
    given ($x) {
      when (3) {
    ...
  ----
  ~~
  ----
  what's the
  opposite?
  ----
  Old
  Perl?
  ----
  if it 
  wor
(1)
  ----
  ~~
  ----
    ~~@x
  ----
    ~(~(@x))
  ----
  bitwise
  negation
  ----
  so ...
  ----
    ~@x
    ->
    ~(scalar @x)
  ----
    ~~$number
    ->
    $number
  ----
    ~~@x
    ->
  
-MMoose -e'print ~~keys %INC'
    84
  ----
  overload::constant
  ----
  lets you
  affect
  parsing
  ----
  numbers
  strings
  ----
  q qq qr
  t s qw
  ----
  i18n.pm
  ----
  ~~"$foo bar"
  loc(
perl ( E/EH/EHERMAN/perl-5.45.4.tar.gz, DROLSKY, 2026; 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 
Perl-Tidy ( S/SH/SHANCOCK/Perl-Tidy-20250912.tar.gz, SHANCOCK, 2025; MetaCPAN )
Perl-Tidy/lib/Perl/Tidy/Tokenizer.pm ( view source; MetaCPAN )
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, '('
Perl-Tidy ( S/SH/SHANCOCK/Perl-Tidy-20250912.tar.gz, SHANCOCK, 2025; MetaCPAN )
Perl-Tidy/lib/Perl/Tidy/VerticalAligner.pm ( view source; MetaCPAN )
]                  ~~ [];
            #  [ ["foo"], ["bar"] ] ~~ [ qr/o/, qr/a/ ];
            #  [ qr/o/, qr/a/ ]     ~~ [ ["foo"], ["bar"] ];
            #  [ "foo", "bar" ]     ~~ [ qr/o/, qr/a/ ];

            #  [ qr/o/, qr/a/ ]     ~~ [ "foo", "bar" ];
            #  $deep1               ~~ $deep1;

            # So we will use two thresholds.
            my $nmin_mono     = $depth + 2;
     
he same left side patterns, so we will align the equals.
    #     my $orig = my $format = "^<<<<< ~~\n";
    #     my $abc  = "abc";
    # But these have a different left pattern so they will not be
Sim-OPT ( G/GL/GLBRUNE/Sim-OPT-0.785.tar.gz, GLBRUNE, 2025; MetaCPAN )
Sim-OPT/lib/Sim/OPT/Report.pm ( view source; MetaCPAN )
= $retfile;
                  #print RETBLOCK "$retfile\n";

                  if ( not ( $retfile ~~ @{ $dirfiles{retcases} } ) )
                  {
                    push ( @{ $dirfiles{retcases}
    say $tee "IN RETRIEVE3 \$countinstance $countinstance";

                  if ( not ( $retfile ~~ @{ $dirfiles{notecases}{$countcase}{$countblock}{$counttool}{$countinstance} } ) )
               
dirfiles{retcases} } );
                my $retfile = $resfile;
                if ( not ($retfile ~~ @{ $dirfiles{retcases} } ) )
                {
                  push ( @{ $dirfiles{retcases} }, 
Sim-OPT ( G/GL/GLBRUNE/Sim-OPT-0.785.tar.gz, GLBRUNE, 2025; MetaCPAN )
Sim-OPT/lib/Sim/OPT/Descend.pm ( view source; MetaCPAN )
y @bag;
  foreach my $elts_r ( @sortthis )
  {
    my @elts = @{ $elts_r };
    
    if ( $elts[0] ~~ @bag )
    {
      push( @bag, $elts[0] );
      next;
    }
    else 
    {
      push( @bag, $el
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
Langertha-Knarr ( G/GE/GETTY/Langertha-Knarr-1.103.tar.gz, GETTY, 2026; MetaCPAN )
Langertha-Knarr/lib/Langertha/Knarr/CLI.pm ( view source; MetaCPAN )
     .  /|    |\ .        Langertha LLM Proxy
   ~~~~~|______|~~~~~
   ~~ ~~~~~~~~~~~~~ ~~    Cargo transport for your LLM calls
   ~~~~~~~~~~~~~~~~~~~~
BANNER
}

1;

__END__

=pod

=encoding UTF-8

=
perl ( E/EH/EHERMAN/perl-5.45.4.tar.gz, DOM, 2026; MetaCPAN )
perl/lib/Pod/Functions.pm ( view source; MetaCPAN )
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    $typedesc 
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    $typedesc 
 ~~  ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
perl ( E/EH/EHERMAN/perl-5.45.4.tar.gz, DOM, 2026; 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.45.4.tar.gz, DROLSKY, 2026; 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;
perl ( E/EH/EHERMAN/perl-5.45.4.tar.gz, DROLSKY, 2026; 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.45.4.tar.gz, DROLSKY, 2026; 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.45.4.tar.gz, DROLSKY, 2026; 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.45.4.tar.gz, DROLSKY, 2026; MetaCPAN )
perl/pod/perlcheat.pod ( view source; MetaCPAN )
se { }
  **                     unless  (e) { } elsif (e) { } else { }
  ! ~ \ u+ u-            given   (e) { when (e) {} default {} }
  =~ !~
  * / % x                 NUMBERS vs STRINGS  FALSE vs TR
           == !=      eq ne
  < > <= >= lt gt le ge   < > <= >=  lt gt le ge
  == != <=> eq ne cmp ~~  <=>        cmp
  &
  | ^             REGEX MODIFIERS       REGEX METACHARS
  &&              /i c
Sim-OPT ( G/GL/GLBRUNE/Sim-OPT-0.785.tar.gz, GLBRUNE, 2025; MetaCPAN )
Sim-OPT/lib/Sim/OPT/Sim.pm ( view source; MetaCPAN )
esfile, $shortflfile );

    #if ( ( $dowhat{simulate} eq "y")
    #  and ( ( ( not ( $to{cleanto} ~~ ( @trieds ) ) ) or ( not ( $precious eq "" ) ) )
    #    or ( ( $gaproc eq "y" ) and ( $fire eq "
           if ( ( not ( $resfile ~~ @{ $dirfiles{simcases} } ) ) and ( not ( -e $resfile ) ) and ( $dowhat{simulate} eq "y")
                and ( not ( $to{cleanto} ~~ ( @trieds ) ) ) )
             
             #  print SIMBLOCK "$resfile\n";
              #}

              if ( ( not ( $resfile ~~ @{ $dirfiles{retcases} } ) ) and ( not ( -e $resfile ) ) )
              {
                push ( 

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