[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Finding the length of the longest string



Larry Rosler wrote:
> 
> my $len = 0;
> $len < length and $len = length
>     for @data;
> 
> Subtler and somewhat faster:
> 
> my $len = "";
> $len ^= $_ for @data;
> $len = length $len;


@a[ map { length } @data ] = ();

print $#a;

Hoo!

John Porter


==== Want to unsubscribe from Fun With Perl?
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org