Paul Wilkins wrote: >From: "kza" <[EMAIL PROTECTED]> > >>On Sun, Jan 20, 2002 at 09:00:57PM +1300, Nick Rout wrote: >> >>>"Mailing Lists/Linux/CLUG" to a string like >>> >>>"Mailing Lists.Linux.CLUG" >>> >>I believe perl can easily use regular expressions in a similar way to >>sed. The perlretut and prelre man pages should help out, (don't seem >>to have those man pages here for some reason, so I won't guess the >>exact syntax, cos no doubt the / and a . have special meaning in >>regexps and will need some sort fo escaping) >> >I think that with perl you use something like \/ with the \ being the escape >character, so presumably if . requires escaping it'll be \. > >So either > s/\//./g >or > s/\//\./g >should do the trick. > >the g tells it to do a global replacement. > >In case the above looks like gibberish (it does to me), it's saying > >s/this/that/g with "this" being "\/" and "that" being "\." > To expand on that, just in case you still have no idea of what he meant. Copy the string you wish to convert ... <code sample> $copy=$string;
$copy~=s/\//\./g; </code sample> Now all occurrences of "/" should be replaced with"." in the string called $copy Good luck, Zane
