> From: Bart Lateur [mailto:[EMAIL PROTECTED]]
> On Mon, 25 Sep 2000 10:19:05 +0100, Simon Cozens wrote:
>
> > (%alphabet) = $string =~ tr/a-z//;
> >
> >Yum.
>
> You want it in a hash? Ooff. Well, maybe that's ok for Perl6.
>
> For Perl5, it would seem to make more sense, to me, to return a list.
> Simply a matter of consistency with the spirit of the rest of the
> language.
>
> @frequency = tr/a-z//;
>
> would stuff the results in:
>
> 'a' -> $frequency[0]
> 'b' -> $frequency[1]
> ...
> 'z' -> $frequency[25]
>
That does'nt scale.
how about
@frequency = tr/a-z0-9//;
or (for those of us who have more than 25 letters in the alfabeth):
@frequency = tr/a-zæøå//;
or how about CAPITALS?
not to mention Unicode - ooomph..
Are the counts stuffed in the array in the order they appear in the
tr-string? or in ascii-order? or whatever?
That just won't work. The original proposal will however (or at least I
can't find any obvious blunders)!
regards
Henrik Tougaard, FOA, Denmark.