Hi,

I have a string that has value delimited by space
e.g. 1 2 10 8 etc.

I need to add a keyword wherever there is a space.
I wrote a small code to try this out:

$str = "one two three";
$str =~ s/\s/x /g;

In this case, I am trying to insert x where there is a space. one two
three should
become one x two x three.
But the above example results in:
nex twox three (chops off leading o char)

The interesting this is that this happens only in debug mode.
The regular output is: onex twox three

Regards

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to