in reply to Re: Favourite modules April 2003
in thread Favourite modules April 2003
Gets you rid of the synthetic @list too. I have no idea what your if/elsif are supposed to sort out, either. And finally, instead of using <DATA>, you can use <> and just pipe the output from grep to the script. A compressed version:for (sort { $module{$a} <=> $module{$b} } keys %module) { printf "%04d, %s\n", $module{$_}, $_; }
And then it's just/^use\s+([^\s;]+)/ && $_{$1}++ while <>; printf "%04d, $_\n", $_{$_} for sort { $_{$b} <=> $_{$a} } keys %_;
$ grep -hr ^use perl/ | perl foo.pl
Makeshifts last the longest.
|
---|