dirtyholmes
Programmer
Hi Guys,
If i wanted to split the following line
$myline = "123 456 +789-123+456 789";
into the following
123
456
+789
-123
+456
789
i.e if i hit a whitespace, a "+" sign or "-" sign i want to split at that point. Is this possible using the split
function.
I can only seem to get it to split on either whitespace, or + or - . I cant seem to get it to split using all three.
I am using something like
such as ...
@mywords = split/\S\+\-/,$myline
Am i doing something wrong, or is it better to use another func.
Regards
Mr Holmes
If i wanted to split the following line
$myline = "123 456 +789-123+456 789";
into the following
123
456
+789
-123
+456
789
i.e if i hit a whitespace, a "+" sign or "-" sign i want to split at that point. Is this possible using the split
function.
I can only seem to get it to split on either whitespace, or + or - . I cant seem to get it to split using all three.
I am using something like
such as ...
@mywords = split/\S\+\-/,$myline
Am i doing something wrong, or is it better to use another func.
Regards
Mr Holmes