...and before someone chastises me (rightly so) for using (??{CODE}) in a
situation where a perfectly good (?{CODE}) would've done just fine, or for
not skipping that first line, or using $1 instead of the more scalable $^N..
Here's a little preemptive redemption:

while (<DATA>) {
>    next if /^>/;
>    () = /(.)(?{ $regex_count{$^N}++; $total++ })/g;
> }
>
> printf "%s\t=>\t%f\n", $_, ($regex_count{$_} / $total) * 100 for sort keys
> %regex_count;
>

Brian.

Reply via email to