Mystik Gotan said:
> If not using length() direcly on @world_list:
>
> @word_list = qw(bla bla bla bla bla joah hey);
Your following code is an expensive noop ...
> foreach $element (@word_list) {
> local($content);
Whoops. Why are you using local? Use my unless you _know_ that you need
local.
> my(@lengths);
Declaring @lengths within the loop means that you cannot see it outside,
and that you get a new array each time round the loop anyway.
> $content = length($element);
> push(@lengths, $element); # or different order, I always forgot this :)
> }
Try something like:
my @lengths = map { length } @word_list;
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]