Skip to content

Commit a1dff12

Browse files
committed
perlop: Move isa() section to proper place
This document is supposed to be in decreasing operator precedence order. isa() is higher than the relational operators, so move it to there.
1 parent d0ebd20 commit a1dff12

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

pod/perlop.pod

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,25 @@ X<-X> X<filetest> X<operator, filetest>
537537

538538
See also L</"Terms and List Operators (Leftward)">.
539539

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+
540559
=head2 Relational Operators
541560
X<relational operator> X<operator, relational>
542561

@@ -661,25 +680,6 @@ function, available in Perl v5.16 or later:
661680

662681
if ( fc($x) eq fc($y) ) { ... }
663682

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-
683683
=head2 Smartmatch Operator
684684

685685
The C<smartmatch> feature is discouraged for new code and retained for

0 commit comments

Comments
 (0)