The original RE is m/\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*/. If this is equivilent to splitting on ' ', then I have some serious remedial RE work to do.
The original RE will match 'ABCD' and split it into 4 characters. Your solution using split will not. I am not sure that the original poster is 100% certain about what the initial RE does, and your solution may match intent, but as written the are not the same.
Now, since you are using the pattern \s+ as your split, then your splits are nearly equivilant (leading space and trailing space aside). However, your split is not equivilant to the original RE.
Nothing personal, just technically misleading. All of the info was correct (++), just not related to the OP (--).
In reply to ('Re: ' x 6) How to remove the $1 hard coding
by MidLifeXis
in thread How to remove the $1 hard coding
by abhishes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |