in reply to replacing pipe "|"

That's because the | is a special character, and you need to escape it. change $rem ="|"; to $rem ="\\|"; and it'll work. Another (cleaner/easier) option is to use \Q and \E (they escape the characters for you). So change s/$rem/$rep/go; to s/\Q$rem\E/$rep/go;

Replies are listed 'Best First'.
Re: Re: replacing pipe "|"
by nadadogg (Acolyte) on Mar 26, 2003 at 21:25 UTC
    Thank you very much guys, and gals, SarahM's answer worked perfectly the first time through, and now maybe ill meet my deadlines :)