At 5:46 PM +0200 10/6/02, Adriano Allora wrote:
>Now I have another problem: the 5.6 version perl on jaguar doesn't accept
>the escape character \s, does it?
>When I use it in a regexp (s/\s+/\s/g;)(I want it works to singularize
>all the multi-whitespaces), the Terminal tells me:
>Unrecognized escape \s passed through at cleaner line 27.

I think the problem is that \s does not specify a single character; rather,
it matches a set of characters.  So, when you ask Perl to substitute in \s,
what character should Perl use?  Here are two alternatives (among many :-):

   s|\s+| |g;            # use a single space
   s|(\s)\s*|$1|g;       # use the first whitespace character

-r
-- 
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com/rdm    - my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc     - Prime Time Freeware's Darwin Collection

Reply via email to