Jonathan Scott Duff <[EMAIL PROTECTED]> writes:
> On Tue, Apr 09, 2002 at 04:17:38PM +0100, Simon Cozens wrote:
>> Aaron Sherman:
>> > nice du -a | sort -n | tail -300 | tac | perl -nle '
>> > die "Require non-zero disk size!\n" unless $ENV{DF};
>> > if ($. == 1) {
>> > $total = $_ + 0;
>> > next;
>> > }
>> > ($size,$rest) = split /\s+/, $_, 2;
>> > if ($rest =~ /^\.\/([\w.\-]+)\//) {
>> > next if $count{$1}++ >= 3;
>> > }
>> > printf "%5.1f%% %5.1f%% %11s %s\n", $size/$ENV{DF}*100,
>> > $size/$total*100, $size, $rest;' |\
>> > head -100
>>
>> This doesn't change at all.
>
> Well, it does but only slightly. $ENV{DF} becomes %ENV{DF} and
> $count{$1} becomes %count{$1} and I'm not sure, but I think that $. is
> changing it's name to something else. Everything else looks like it
> stays the same though.
I think $count{$1} will still work. $count will just be autovivified
as a hashref.
--
Piers
"It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite."
-- Jane Austen?