[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoscan -v produces gigabytes of output - take 2
From: |
Akim Demaille |
Subject: |
Re: autoscan -v produces gigabytes of output - take 2 |
Date: |
02 Feb 2001 17:41:42 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake) |
> foreach my $word (sort keys %identifiers)
> {
> print "$word: @{$identifiers{$word}}\n";
> }
Wow! That's cute...
> In fact, there's enough duplication in those 6 loops that
> it's probably worthwhile to factor them. How about this:
>
> foreach my $class (qw (functions identifiers headers
> makevars libraries programs))
> {
> print "\n$class:\n";
> my $h = eval "\\\%$class";
> foreach my $word (sort keys %$h)
> {
> print "$word: @{$h->{$word}}\n";
> }
> }
So Perl _can_ be beautiful ;)