Re: Transforming a space-separated string to an array for words.

2005-01-13 Thread Bryan R Harris
> Robin <[EMAIL PROTECTED]> suggested: >> This will split up the string based on the pattern (in this >> case, a single space. You may want to change that to gain >> robustness, e.g. /[ \t]+/ will split on any number of spaces and tabs) > > I suggest /\s+/ instead. This splits on any whitespace,

RE: Transforming a space-separated string to an array for words.

2005-01-13 Thread Thomas Bätzler
Robin <[EMAIL PROTECTED]> suggested: > This will split up the string based on the pattern (in this > case, a single space. You may want to change that to gain > robustness, e.g. /[ \t]+/ will split on any number of spaces and tabs) I suggest /\s+/ instead. This splits on any whitespace, and it'l

Re: Transforming a space-separated string to an array for words.

2005-01-12 Thread Robin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 13 Jan 2005 20:02, Harold Castro wrote: > my $numbers = ; > my @array = $numbers; Amend to: my @array = split(/ /,$numbers); This will split up the string based on the pattern (in this case, a single space. You may want to change that to gain

Transforming a space-separated string to an array for words.

2005-01-12 Thread Harold Castro
Good day, This would be quick and simple. I need to write a script that will prompt the user(using ) to enter a series of numbers separated by white space and then push each of those numbers into an array and then do anything such as sorting it from highest to lowest. I've tried doing it as: p

Transforming a space-separated string to an array for words.

2005-01-12 Thread Harold Castro
Good day, This would be quick and simple. I need to write a script that will prompt the user(using ) to enter a series of numbers separated by white space and then push each of those numbers into an array and then do anything such as sorting it from highest to lowest. I've tried doing it as: p