Brent Clark wrote:
> Hi all
Hello,
> 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;
>
> Would someone be so kind as to check this for me.
You don't need the /o option as the regular expression is already compiled.
perldoc -q "/o"
And you apparently don't need the capturing parentheses.
You probably want something like this:
for ( $p110rm01 ) {
s/\sroom//ig;
s/^\s+//;
s/\s+$//;
}
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>