This is correct, but for the sake of readability I'd put the /\s+/ in there
anyway. 

-----Original Message-----
From: Deen Hameed [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 10:39 PM
To: Daniel Falkenberg
Cc: [EMAIL PROTECTED]
Subject: Re: Splitting variable...



# split works on whitespace by default
@somearray = split $string;

deen
-- 
Deen Hameed, Accidental Programmer [EMAIL PROTECTED]

On Thu, 21 Feb 2002, Daniel Falkenberg wrote:

> Hey all,
> 
> I am working with a variable at the moment where I want it to be split
> at every 'space' such as ...
> 
> $string = "the quick brown fox";
> 
> How would I go about doing this?  Would I do something like the
> following...
> 
> @line = split/\s+/, $string;
> 
> $line[0] = the
> $line[1] = quick
> $line[2] = brown
> $line[3] = fox
> 
> Any suggestions?
> 
> Regards,
> 
> Dan
> 
> 



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


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

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

Reply via email to