On Tue, Nov 4, 2008 at 4:35 PM, Sharan Basappa <[EMAIL PROTECTED]>wrote:
> > You are completely right. :-) > > > > What you want to be doing is this: $temp =~ s/\s+/ /g; > > The reason for that is simple, \s is used to match a space or multiple > > spaces, it is not used to print a space that is actually done by the ' ' > > (space). It might seem a little strange at first but just try and think > of > > how you would read something like s/ {10}/........../g; that would make > no > > sense at all and you would have to go count the number of spaces so when > > matchin you use \s to represend a space, but when printing or > substituting > > you simple use the ' ' (space). > > Thanks. BTW, a variable ($x = " ") instead of actual space would do, right? > Yeah that should work just fine.