> -----Original Message-----
> From: Frank Newland [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 29, 2001 4:40 PM
> To: [EMAIL PROTECTED]
> Subject: Regex syntax
> 
> 
> Hey,
> 
> On an Oct 25 thread, someone asked how to remove trailing spaces.
> The response was $Value =~ s/\s+$//.
> 
> Question.
> 
> 1. The string upon which this operation was made is on $_ correct?

No. It was on $Value (the lvalue to the left of the =~ operator)

$_ is used if you leave out the =~ altogether. The following two
statements are equivalent:

   $_ =~ s/foo/bar/;
   s/foo/bar/;

> 2. If I've made the assignment $tempstring = substr($_ ,0,20) how do I
> remove trailing spaces from $tempstring?

   $tempstring =~ s/\s+$//;

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

Reply via email to