> 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,
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
-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
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
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