develooper Front page | perl.perl5.porters | Postings from April 2003

Re: [perl #7213] [PATCH] Updating example in perldata

Thread Previous | Thread Next
From:
Tony Cook
Date:
April 24, 2003 18:14
Subject:
Re: [perl #7213] [PATCH] Updating example in perldata
Message ID:
20030425011422.GC20861@develop-help.com
On Thu, Apr 24, 2003 at 08:42:32PM -0400, Casey West wrote:
> http://rt.perl.org/rt2/Ticket/Display.html?id=7213
> --- perl-current.orig/pod/perldata.pod  Mon Mar  4 04:18:27 2002
> +++ perl-current/pod/perldata.pod       Thu Apr 24 20:35:56 2003
> @@ -644,7 +644,7 @@
>  
>      foreach (@array[ 4 .. 10 ]) { s/peter/paul/ } 
>  
> -    foreach (@hash{keys %hash}) {
> +    foreach (values %hash) {
>          s/^\s+//;           # trim leading whitespace
>          s/\s+$//;           # trim trailing whitespace
>          s/(\w+)/\u\L$1/g;   # "titlecase" words

The problem is you're no longer demonstrating that the results of a hash
slice is an lvalue.

Maybe:

      foreach (@hash{qw/title subtitle/}) {

(still not a great example)

Tony

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About