This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix on doc patch from Moritz Lenz (from IRC)
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Fri, 22 Oct 2010 10:40:26 +0000 (12:40 +0200)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Fri, 22 Oct 2010 10:40:26 +0000 (12:40 +0200)
pod/perldata.pod

index 4f08d24..4ec9eb5 100644 (file)
@@ -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