> I don't know if it is "better" or faster, but it is shorter.  :-)
> 
> $ perl -le'
> my @array = ( "123", "abc", "def", 1 .. 9 );
> my $len_of_array = do { local $"; length "@array" };
> print $len_of_array;
> '
> 18
> 
> $ perl -le'
> my %hash = ( 1 => 2, 2 => 3, 3 => 4 );
> my $len_of_hash = do { local $"; length "@{[%hash]}" };
> print $len_of_hash;
> '
> 6
> 

if just shorter, I guess I will do in this  way :
print length ( join "", @array);
print length ( join "", %hash);

But I am not sure if this will eat up (much) more of my memory....


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to