in reply to Help with substitution - - 15 Characters from the left

For your if statement take a look at substr and index.

$foo =~ s/\s/\\g;
The code above is not working, what would work is: $foo =~ s/\s//g; # not efficient which substitutes every whitespace (\s, i.e. space, tab, newline, ...) with nothing. Thus every whitespace is deleted. But I don't see how that could help you for your problem.

For your replacements you should look at the tr/// operator.

-- Hofmator

Replies are listed 'Best First'.
Re: Re: Help with substitution - - 15 Characters from the left
by La12 (Sexton) on Aug 13, 2001 at 23:50 UTC
    The last question about the spaces was not related to the main problem. I just saw someone post it and thought that you could not substitute something with nothing. I will check out tr///.