> I need to remove the string "room" (notice the check for a space too) and 
> also to check for spaces in the beginnig  and then maybe at the end
> of the total string.
> 
> $p110rm01 =~ s/(\sroom|^\s*|\s*$)//igo;
> 

It is correct. You can try as,

# echo " hi this is a room ok" | perl -ne 'if ( /\s*.*\sroom.*\s*/ ) {
s/ room//;}print;'
# hi this is a ok

hth.

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


Reply via email to