If not using length() direcly on @world_list:
@word_list = qw(bla bla bla bla bla joah hey);
foreach $element (@word_list) {
local($content);
my(@lengths);
$content = length($element);
push(@lengths, $element); # or different order, I always forgot this :)
}
--------------
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
From: "Tanton Gibbs" <[EMAIL PROTECTED]>
To: "Erik Browaldh"
<[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject: Re: transforming strings to an array of characters
Date: Mon, 9 Dec 2002 07:35:04 -0500
I know this has already been answered, but usually you can do things more
efficiently on the string itself...what are you trying to do?
Tanton
----- Original Message -----
From: "Erik Browaldh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 09, 2002 7:24 AM
Subject: transforming strings to an array of characters
> hi everyone!
>
> if I have a string, lets say
> $word="perl";
>
> I want to copy this so I have something like this:
> @word_list["p","e","r","l"]
>
> also, how do I get the length of @word_list?
>
> thanks in advance!
> Erik
>
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Chatten met je online vrienden via MSN Messenger. http://messenger.msn.nl/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]