@@ -537,6 +537,25 @@ X<-X> X<filetest> X<operator, filetest>
537
537
538
538
See also L</"Terms and List Operators (Leftward)">.
539
539
540
+ =head2 Class Instance Operator
541
+ X<isa operator>
542
+
543
+ Binary C<isa> evaluates to true when the left argument is an object instance of
544
+ the class (or a subclass derived from that class) given by the right argument.
545
+ If the left argument is not defined, not a blessed object instance, nor does
546
+ not derive from the class given by the right argument, the operator evaluates
547
+ as false. The right argument may give the class either as a bareword or a
548
+ scalar expression that yields a string class name:
549
+
550
+ if( $obj isa Some::Class ) { ... }
551
+
552
+ if( $obj isa "Different::Class" ) { ... }
553
+ if( $obj isa $name_of_class ) { ... }
554
+
555
+ This feature is available from Perl 5.31.6 onwards when enabled by
556
+ C<use feature 'isa'>. This feature is enabled automatically by a
557
+ C<use v5.36> (or higher) declaration in the current scope.
558
+
540
559
=head2 Relational Operators
541
560
X<relational operator> X<operator, relational>
542
561
@@ -661,25 +680,6 @@ function, available in Perl v5.16 or later:
661
680
662
681
if ( fc($x) eq fc($y) ) { ... }
663
682
664
- =head2 Class Instance Operator
665
- X<isa operator>
666
-
667
- Binary C<isa> evaluates to true when the left argument is an object instance of
668
- the class (or a subclass derived from that class) given by the right argument.
669
- If the left argument is not defined, not a blessed object instance, nor does
670
- not derive from the class given by the right argument, the operator evaluates
671
- as false. The right argument may give the class either as a bareword or a
672
- scalar expression that yields a string class name:
673
-
674
- if( $obj isa Some::Class ) { ... }
675
-
676
- if( $obj isa "Different::Class" ) { ... }
677
- if( $obj isa $name_of_class ) { ... }
678
-
679
- This feature is available from Perl 5.31.6 onwards when enabled by
680
- C<use feature 'isa'>. This feature is enabled automatically by a
681
- C<use v5.36> (or higher) declaration in the current scope.
682
-
683
683
=head2 Smartmatch Operator
684
684
685
685
The C<smartmatch> feature is discouraged for new code and retained for
0 commit comments