That would do it.  Without the 's' in front of the regex, it doesn't know
you're trying to search and replace.

The divide error is odd, and shouldn't be happening, but try this instead:
        s(\s*)()g

-----Original Message-----
From: Scott Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:10 PM
To: 'Mooney Christophe-CMOONEY1'
Cc: Perl Help
Subject: RE: Remove White Space


No error messages or anything, but the white space is still in there.  I
did, however change the syntax to 
$var=~ s/\s*//g;
From
$var=~/\s*//g;
Because I got a divide error when using the later.

-Scott



-----Original Message-----
From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 06, 2001 5:01 PM
To: 'Perl Help'
Subject: RE: Remove White Space


What happens when you try?

-----Original Message-----
From: Scott Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 4:05 PM
To: 'Mooney Christophe-CMOONEY1'
Cc: 'Perl Help'
Subject: RE: Remove White Space


That's what I thought it would be but still no luck.

-Scott

-----Original Message-----
From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 06, 2001 4:52 PM
To: Perl Help
Subject: RE: Remove White Space


$var=~/\s*//g;  # ;)

-----Original Message-----
From: Scott Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 3:56 PM
To: Perl Help
Subject: RE: Remove White Space


After I sent it out, I actually came up with the idea myself after some
digging. (go figure) any case, I am now having another problem which,
even after some research still proves difficult.  I have a variable
like:  file .htm but what I want to do is trim the white space between
file and .htm   any ideas?

-Scott


-----Original Message-----
From: Bob Showalter [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 06, 2001 4:45 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Remove White Space


> -----Original Message-----
> From: Scott Martin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 06, 2001 4:13 PM
> To: Perl Help
> Subject: Remove White Space
> 
> 
> How can I remove white space from the beginning of a variable?

This is a FAQ:

   perldoc -q strip

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to