Re: list of strings to array

2004-02-21 Thread Rob Dixon
David Le Blanc wrote : > > > Just a note. > > @array = split / /, "one two three four"; > > and > > @array = split " ", "one two three four"; > > are not the same. The second is special-cased inside perl to do the > same as the AWK split command. The first is just a normal regular > expression mat

RE: list of strings to array

2004-02-21 Thread David le Blanc
> From: Jenda Krynicky [mailto:[EMAIL PROTECTED] > Sent: Saturday, 21 February 2004 10:01 AM > To: Perl Beginners > Subject: Re: list of strings to array > > From: Jacob Chapa <[EMAIL PROTECTED]> > > Is there any way to split up a string and put it into an array...

Re: list of strings to array

2004-02-20 Thread Jenda Krynicky
From: Jacob Chapa <[EMAIL PROTECTED]> > Is there any way to split up a string and put it into an array > > something like this: > > if I had a string: > > one two three four > > or > > one;two;three;four > > Can I put "one" into the first element, "two" into the second, etc... > knowing w

Re: list of strings to array

2004-02-20 Thread James Edward Gray II
On Feb 20, 2004, at 2:31 PM, Jacob Chapa wrote: Is there any way to split up a string and put it into an array You bet. something like this: if I had a string: one two three four my @words = split ' ', 'one two three four'; # splits on whitespace or one;two;three;four my @words = split /

list of strings to array

2004-02-20 Thread Jacob Chapa
Is there any way to split up a string and put it into an array something like this: if I had a string: one two three four or one;two;three;four Can I put "one" into the first element, "two" into the second, etc... knowing what splits up the string. For instance, in the first one a space