List Info

Thread: Re: weird length error




Re: weird length error
user name
2006-05-19 10:24:44
On May 20, 2006, at 0:06 , Sam Strasser wrote:

> my $prim_cat = $story->get_primary_category;
> my ancestors = $prim_cat->ancestry;
> my $an = $ancestors[1];
> my $arch_len = length $an;
> $burner->throw_error($an->get_uri . ":"
. $arch_len);


> I don't understand how $an can be '/archive' and
therefore 8  
> characters
> but length $an is 35?

AIUI, $an is a category object. I'm not sure what length $an
really  
calculates for an object. $an->get_uri returns a string.
I think  
you're getting different answers because you're comparing
different  
things.

> Is there another way to get length or am I doing
> something wrong here?

It depends on what length you're trying to measure. I assume
you're  
trying to get the length of the URI string, so length
$an->get_uri is  
what you'd want to do in that case, I should think.

Does that make sense?


Michael Glaesemann
grzm seespotcode net




[1]

about | contact  Other archives ( Real Estate discussion Medical topics )