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
> 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...
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
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 /
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