@@ -79,16 +79,16 @@ at all if the short-circuiting means that it's not required for any
79
79
comparisons.) This matters if the computation of an interior argument
80
80
is expensive or non-deterministic. For example,
81
81
82
- if($x < expensive_sub() <= $z) { ...
82
+ if ($x < expensive_sub() <= $z) { ...
83
83
84
84
is not entirely like
85
85
86
- if($x < expensive_sub() && expensive_sub() <= $z) { ...
86
+ if ($x < expensive_sub() && expensive_sub() <= $z) { ...
87
87
88
88
but instead closer to
89
89
90
90
my $tmp = expensive_sub();
91
- if($x < $tmp && $tmp <= $z) { ...
91
+ if ($x < $tmp && $tmp <= $z) { ...
92
92
93
93
in that the subroutine is only called once. However, it's not exactly
94
94
like this latter code either, because the chained comparison doesn't
@@ -547,10 +547,10 @@ not derive from the class given by the right argument, the operator evaluates
547
547
as false. The right argument may give the class either as a bareword or a
548
548
scalar expression that yields a string class name:
549
549
550
- if( $obj isa Some::Class ) { ... }
550
+ if ( $obj isa Some::Class ) { ... }
551
551
552
- if( $obj isa "Different::Class" ) { ... }
553
- if( $obj isa $name_of_class ) { ... }
552
+ if ( $obj isa "Different::Class" ) { ... }
553
+ if ( $obj isa $name_of_class ) { ... }
554
554
555
555
This feature is available from Perl 5.31.6 onwards when enabled by
556
556
C<use feature 'isa'>. This feature is enabled automatically by a
@@ -1591,7 +1591,7 @@ is the same as
1591
1591
1592
1592
Note, however, that this does not always work for quoting Perl code:
1593
1593
1594
- $s = q{ if($x eq "}") ... }; # WRONG
1594
+ $s = q{ if ($x eq "}") ... }; # WRONG
1595
1595
1596
1596
is a syntax error. The C<L<Text::Balanced>> module (standard as of v5.8,
1597
1597
and from CPAN before then) is able to do this properly.
0 commit comments