This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a0da440
)
Fix on doc patch from Moritz Lenz (from IRC)
author
H.Merijn Brand
<h.m.brand@xs4all.nl>
Fri, 22 Oct 2010 10:40:26 +0000
(12:40 +0200)
committer
H.Merijn Brand
<h.m.brand@xs4all.nl>
Fri, 22 Oct 2010 10:40:26 +0000
(12:40 +0200)
pod/perldata.pod
patch
|
blob
|
blame
|
history
diff --git
a/pod/perldata.pod
b/pod/perldata.pod
index
4f08d24
..
4ec9eb5
100644
(file)
--- a/
pod/perldata.pod
+++ b/
pod/perldata.pod
@@
-766,7
+766,7
@@
Slices in scalar context return the last item of the slice.
@a = qw/first second third/;
%h = (first => 'A', second => 'B');
$t = @a[0, 1]; # $t is now 'second'
- $u = @h{'first', 'second'}; # $u is now '
second
'
+ $u = @h{'first', 'second'}; # $u is now '
B
'
If you're confused about why you use an '@' there on a hash slice
instead of a '%', think of it like this. The type of bracket (square