argra****@users*****
argra****@users*****
2012年 5月 21日 (月) 22:41:01 JST
Index: docs/perl/5.10.1/perlfaq4.pod diff -u docs/perl/5.10.1/perlfaq4.pod:1.11 docs/perl/5.10.1/perlfaq4.pod:1.12 --- docs/perl/5.10.1/perlfaq4.pod:1.11 Fri Aug 26 10:31:16 2011 +++ docs/perl/5.10.1/perlfaq4.pod Mon May 21 22:41:00 2012 @@ -4390,7 +4390,7 @@ my $key_count = keys %hash; # must be scalar context! =begin original - + If you want to find out how many entries have a defined value, that's a bit different. You have to check each value. A C<grep> is handy: @@ -4417,7 +4417,7 @@ my $vowel_count = grep { /[aeiou]/ } keys %hash; =begin original - + The C<grep> in scalar context returns the count. If you want the list of matching items, just use it in list context instead: