New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] Fix use of == to compare strings in perlref.pod #15094
Comments
From @ilmariCreated by @ilmariThe examples for refaliasing were using == to compare strings. Perl Info
|
From @ilmari0001-Fix-use-of-to-compare-strings-in-perlref.pod.patchFrom 8dbef62fbe38ab1811044a0fd27425d7d8c8f3f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Tue, 15 Dec 2015 23:45:00 +0000
Subject: [PATCH] Fix use of == to compare strings in perlref.pod
---
pod/perlref.pod | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pod/perlref.pod b/pod/perlref.pod
index e570b72..5804c17 100644
--- a/pod/perlref.pod
+++ b/pod/perlref.pod
@@ -887,7 +887,7 @@ for obfuscated code:
# @harry is (1,2,3)
my $type = ref $thingy;
- ($type ? $type == 'ARRAY' ? \@foo : \$bar : $baz) = $thingy;
+ ($type ? $type eq 'ARRAY' ? \@foo : \$bar : $baz) = $thingy;
The C<foreach> loop can also take a reference constructor for its loop
variable, though the syntax is limited to one of the following, with an
@@ -906,7 +906,7 @@ arrays-of-arrays, or arrays-of-hashes:
}
foreach \my %h (@array_of_hashes) {
- $h{gelastic}++ if $h{type} == 'funny';
+ $h{gelastic}++ if $h{type} eq 'funny';
}
B<CAVEAT:> Aliasing does not work correctly with closures. If you try to
--
2.6.2
|
@khwilliamson - Status changed from 'new' to 'open' |
From @khwilliamsonThanks, applied as 74bfae2 |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for submitting this report. You have helped make Perl better. Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0 |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#126933 (status was 'resolved')
Searchable as RT126933$
The text was updated successfully, but these errors were encountered: